3d281cf1a37f9b982df130c2ce9706cfc66a88aa,pandas/core/apply.py,Apply,agg_list_like,#Apply#Any#,200

Before Change


        keys = []

        // degenerate case
        if selected_obj.ndim == 1:
            for a in arg:
                colg = obj._gotitem(selected_obj.name, ndim=1, subset=selected_obj)
                try:
                    new_res = colg.aggregate(a)

                except TypeError:
                    pass
                else:
                    results.append(new_res)

                    // make sure we find a good name
                    name = com.get_callable_name(a) or a
                    keys.append(name)

        // multiples
        else:
            for index, col in enumerate(selected_obj):
                colg = obj._gotitem(col, ndim=1, subset=selected_obj.iloc[:, index])
                try:
                    new_res = colg.aggregate(arg)
                except (TypeError, DataError):
                    pass
                except ValueError as err:
                    // cannot aggregate
                    if "Must produce aggregated value" in str(err):
                        // raised directly in _aggregate_named
                        pass
                    elif "no results" in str(err):
                        // raised directly in _aggregate_multiple_funcs
                        pass
                    else:
                        raise
                else:
                    results.append(new_res)
                    keys.append(col)

        // if we are empty
        if not len(results):
            raise ValueError("no results")

        try:

After Change


            //     result = results[0]
            // else:
            result = concat(results, keys=keys, axis=1, sort=False)
            if all([e == 1 for e in ndims]):
                result = result.T.infer_objects()
        except TypeError as err:

            // we are concatting non-NDFrame objects,
            // e.g. a list of scalars
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pandas-dev/pandas
Commit Name: 3d281cf1a37f9b982df130c2ce9706cfc66a88aa
Time: 2021-02-17
Author: rhshadrach@gmail.com
File Name: pandas/core/apply.py
Class Name: Apply
Method Name: agg_list_like


Project Name: albermax/innvestigate
Commit Name: 05fc3863f9b6c5b9a0393368fb02e999f1fc4d32
Time: 2018-04-15
Author: work.alber.maximilian@gmail.com
File Name: innvestigate/utils/keras/graph.py
Class Name:
Method Name: get_layer_from_config


Project Name: adalca/neuron
Commit Name: 1c6277ecb801327ce4b2e376e1e13a18b79ba52c
Time: 2018-08-26
Author: adalca@mit.edu
File Name: neuron/layers.py
Class Name: DenseSpatialTransformer
Method Name: call