fefc1fc7fefd84f31018a4b02e08df6e4ae5fa71,QUANTAXIS/QAData/data_resample.py,,QA_data_day_resample,#Any#Any#,105

Before Change


        day_data=day_data.set_index("date",drop=False)

    day_data_p = day_data.resample(type_).last()
    return day_data_p.assign(open=day_data.open.resample(type_).first()).assign(high=day_data.high.resample(type_).max()).assign(low=day_data.low.resample(type_).min())\
                .assign(vol=day_data.vol.resample(type_).sum() if "vol" in day_data.columns else day_data.volume.resample(type_).sum())\
                .assign(amount=day_data.amount.resample(type_).sum()).dropna().set_index("date")

After Change



    day_data_p = day_data.resample(type_).last()

    CONVERSION = {"open": "first", "high": "max", "low": "min", "close": "last", "vol": "sum"} if "vol" in day_data.columns else {
        "open": "first", "high": "max", "low": "min", "close": "last", "volume": "sum"}

    return day_data.resample(type_, closed="right").apply(CONVERSION)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: fefc1fc7fefd84f31018a4b02e08df6e4ae5fa71
Time: 2018-08-02
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/data_resample.py
Class Name:
Method Name: QA_data_day_resample


Project Name: comic/grand-challenge.org
Commit Name: 6ac71c8dea5f7bb18e6f5ca040ad9313427b2d9b
Time: 2020-01-28
Author: 57257130+MikeOverkamp-diag@users.noreply.github.com
File Name: app/grandchallenge/reader_studies/signals.py
Class Name:
Method Name: assign_score


Project Name: comic/grand-challenge.org
Commit Name: 20069ee7de7037e80d1c44af098f12d89ab0a506
Time: 2019-03-19
Author: code@jmsmkn.com
File Name: app/grandchallenge/challenges/tasks.py
Class Name:
Method Name: update_filter_classes