f49809322491c857d435bb12f5de7b09aac2d181,linearmodels/panel/data.py,PanelData,mean,#PanelData#Any#Any#,378

Before Change


            mu = np.nanmean(v, axis=axis)
        else:
            w = weights.values3d
            w = w * np.isfinite(v)
            wv = w * v
            mu = np.nansum(wv, axis=axis)
            mu /= np.nansum(w, axis=axis)

After Change


            w = weights.values2d
            frame = self._frame.copy()
            frame = w * frame
            weighted_sum = frame.groupby(level=level).sum()
            frame.iloc[:, :] = w
            sum_weights = frame.groupby(level=level).sum()
            mu = weighted_sum / sum_weights

        reindex = self.entities if group == "entity" else self.time
        out = mu.loc[reindex]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: bashtage/linearmodels
Commit Name: f49809322491c857d435bb12f5de7b09aac2d181
Time: 2017-04-14
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/data.py
Class Name: PanelData
Method Name: mean


Project Name: elfi-dev/elfi
Commit Name: eb8c188803d258dbcae61764ffe8085db627424b
Time: 2019-11-25
Author: 33959025+hpesonen@users.noreply.github.com
File Name: elfi/examples/daycare.py
Class Name:
Method Name: daycare


Project Name: automl/SMAC3
Commit Name: 1a1d444b0d02c0c484decfb03bf57b18d4af0e85
Time: 2016-12-19
Author: marius.rks@googlemail.com
File Name: smac/epm/rfr_imputator.py
Class Name: RFRImputator
Method Name: impute