dbeab7509cfec1314b6529d57fbd090ce744695c,trackpy/motion.py,,compute_drift,#Any#Any#Any#,237

Before Change


    del delta["frame"]
    delta.reset_index("particle", drop=True, inplace=True)
    delta.reset_index("frame", drop=False, inplace=True)
    dx = delta.groupby("frame").mean()
    if smoothing > 0:
        dx = pd.rolling_mean(dx, smoothing, min_periods=0)
    x = dx.cumsum(0)[pos_columns]
    return x


def subtract_drift(traj, drift=None, inplace=False):

After Change


    f_diff = f_sort[list(pos_columns) + ["particle", "frame"]].diff()

    // Rename the frame column and insert the original frame column back in.
    f_diff.rename(columns={"frame": "frame_diff"}, inplace=True)
    f_diff["frame"] = f_sort["frame"]

    // Compute the per frame averages. Keep only deltas of the same particle,
    // and between frames that are consecutive, and of the same particle.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: soft-matter/trackpy
Commit Name: dbeab7509cfec1314b6529d57fbd090ce744695c
Time: 2017-07-27
Author: caspervdw@gmail.com
File Name: trackpy/motion.py
Class Name:
Method Name: compute_drift


Project Name: has2k1/plotnine
Commit Name: 3c23a55f84ab81bf825f266bab38b5bd6cbd09b1
Time: 2018-07-31
Author: has2k1@gmail.com
File Name: plotnine/facets/facet_wrap.py
Class Name: facet_wrap
Method Name: compute_layout


Project Name: catalyst-cooperative/pudl
Commit Name: f8020951745d45a7367f3e63cd639a682fd3d79a
Time: 2019-06-11
Author: zane.selvans@catalyst.coop
File Name: pudl/transform/eia.py
Class Name:
Method Name: _occurrence_consistency