a498f3fe9373f1837ba9e003166056181448b1f7,upsetplot/plotting.py,,_process_data,#Any#Any#Any#,12
Before Change
totals = []
for i in range(data.index.nlevels):
idxslice = pd.IndexSlice[(slice(None),) * i + (True,)]
// FIXME: can get IndexingError if level only contains False
totals.append(data .loc[idxslice].sum())
totals = pd.Series(totals, index=data.index.names)
if sort_sets_by == "cardinality":
totals.sort_values(ascending=False, inplace=True)
After Change
if data.ndim != 1:
raise ValueError("data must be a pandas.Series")
totals = [data[data.index.get_level_values(name)].sum()
for name in data.index.names]
totals = pd.Series(totals, index=data.index.names)
if sort_sets_by == "cardinality":
totals.sort_values(ascending=False, inplace=True)
elif sort_sets_by is not None:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: jnothman/UpSetPlot
Commit Name: a498f3fe9373f1837ba9e003166056181448b1f7
Time: 2019-02-24
Author: joel.nothman@gmail.com
File Name: upsetplot/plotting.py
Class Name:
Method Name: _process_data
Project Name: ericmjl/pyjanitor
Commit Name: 1b54718668c7c52705de21e9ca1778485a9fc201
Time: 2021-04-06
Author: samueloranyeli@gmail.com
File Name: janitor/utils.py
Class Name:
Method Name: _sub_complete_column
Project Name: bokeh/bokeh
Commit Name: 061d916ba77932d50e41c83f476d8c0d55674856
Time: 2018-10-13
Author: xavart2011@gmail.com
File Name: examples/app/gapminder/main.py
Class Name:
Method Name: