7f5ffac4a2d292e215142c56fe97dcf53be560d6,cnvlib/smoothing.py,,rolling_median,#Any#Any#,34

Before Change


    signal = np.concatenate((x[wing:], x[:-wing-1:-1]))
    // Calculate the rolling median at each subsequent point
    for i, item in enumerate(signal):
        old = window.popleft()
        window.append(item)
        del sortwin[bisect_left(sortwin, old)]
        insort(sortwin, item)
        result[i] = sortwin[wing]

After Change


    // Pad the edges of the original array with mirror copies
    signal = np.concatenate((x[wing-1::-1], x, x[:-wing-1:-1]))
    rolled = pd.rolling_median(signal, 2 * wing + 1, center=True)
    return rolled[wing:-wing]


def rolling_quantile(x, width, quantile):
    Rolling quantile (0--1) with mirrored edges.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: etal/cnvkit
Commit Name: 7f5ffac4a2d292e215142c56fe97dcf53be560d6
Time: 2016-01-06
Author: eric.talevich@gmail.com
File Name: cnvlib/smoothing.py
Class Name:
Method Name: rolling_median


Project Name: pytorch/pytorch
Commit Name: 7ae7768617cba5863ecd14f1169fa75682897fbc
Time: 2021-02-24
Author: benjamin.lefaudeux@gmail.com
File Name: torch/distributed/optim/zero_redundancy_optimizer.py
Class Name: ZeroRedundancyOptimizer
Method Name: _broadcast_params


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 481cf745158704e5173ff6e4a26808ebb04dfc14
Time: 2017-12-24
Author: max.lapan@gmail.com
File Name: ch11/01_a3c_data.py
Class Name:
Method Name: data_func