4a6c3c56f54bf1f85f35aaae76dc76e7cf567b8f,pandas/core/aggregation.py,,aggregate,#Any#Any#,531

Before Change



            // we are a Series like object,
            // but may have multiple aggregations
            if len(sl) == 1:

                result = _agg(
                    arg, lambda fname, agg_how: _agg_1dim(obj._selection, agg_how)
                )

            // we are selecting the same set as we are aggregating
            elif not len(sl - set(keys)):

                result = _agg(arg, _agg_1dim)

            // we are a DataFrame, with possibly multiple aggregations
            else:

                result = _agg(arg, _agg_2dim)

        // no selection
        else:

            try:
                result = _agg(arg, _agg_1dim)

After Change


        if selected_obj.ndim == 1:
            // key only used for output
            colg = obj._gotitem(obj._selection, ndim=1)
            results = {key: colg.agg(how) for key, how in arg.items()}
        else:
            // key used for column selection and output
            results = {
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pandas-dev/pandas
Commit Name: 4a6c3c56f54bf1f85f35aaae76dc76e7cf567b8f
Time: 2020-10-10
Author: 45562402+rhshadrach@users.noreply.github.com
File Name: pandas/core/aggregation.py
Class Name:
Method Name: aggregate


Project Name: catalyst-cooperative/pudl
Commit Name: 5cb8ebe7712623b1a31896eb13b1a37eced0c998
Time: 2017-11-10
Author: cgosnell@catalyst.coop
File Name: pudl/outputs.py
Class Name:
Method Name: generation_eia923


Project Name: pandas-dev/pandas
Commit Name: b92526b81812bbd7ba06e04e2908e49ff3baaa94
Time: 2021-03-14
Author: 45562402+rhshadrach@users.noreply.github.com
File Name: pandas/core/apply.py
Class Name: FrameApply
Method Name: agg