ae0d302c735720739ed4e1bc1e1a231df24356c0,pandas/core/reshape/reshape.py,,_stack_multi_columns,#Any#Any#Any#,596

Before Change



    // tuple list excluding level for grouping columns
    if len(frame.columns.levels) > 2:
        tuples = list(
            zip(
                *[
                    lev.take(level_codes)
                    for lev, level_codes in zip(
                        this.columns.levels[:-1], this.columns.codes[:-1]
                    )
                ]
            )
        )
        unique_groups = [key for key, _ in itertools.groupby(tuples)]
        new_names = this.columns.names[:-1]
        new_columns = MultiIndex.from_tuples(unique_groups, names=new_names)
    else:

After Change



    // tuple list excluding level for grouping columns
    if len(frame.columns.levels) > 2:
        levs = []
        for lev, level_codes in zip(this.columns.levels[:-1], this.columns.codes[:-1]):
            if -1 in level_codes:
                lev = np.append(lev, None)
            levs.append(np.take(lev, level_codes))
        tuples = list(zip(*levs))
        unique_groups = [key for key, _ in itertools.groupby(tuples)]
        new_names = this.columns.names[:-1]
        new_columns = MultiIndex.from_tuples(unique_groups, names=new_names)
    else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: pandas-dev/pandas
Commit Name: ae0d302c735720739ed4e1bc1e1a231df24356c0
Time: 2021-02-03
Author: 61934744+phofl@users.noreply.github.com
File Name: pandas/core/reshape/reshape.py
Class Name:
Method Name: _stack_multi_columns


Project Name: explosion/spaCy
Commit Name: fe498b3d5e1e29fb756c203d50e217e8f258e561
Time: 2017-11-06
Author: ines@ines.io
File Name: examples/training/train_textcat.py
Class Name:
Method Name: main


Project Name: soft-matter/trackpy
Commit Name: 42be11c7824427fb0a8490f3bcd635410ded57b3
Time: 2017-07-27
Author: caspervdw@gmail.com
File Name: trackpy/linking/find_link.py
Class Name: FindLinker
Method Name: get_relocate_candidates