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: 4

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: quiltdata/quilt
Commit Name: e5c62b49200a6adef9f9c92469b866161f999046
Time: 2020-09-23
Author: kevinemoore@gmail.com
File Name: lambdas/pkgselect/index.py
Class Name:
Method Name: file_list_to_folder


Project Name: catalyst-cooperative/pudl
Commit Name: f3ed367fe1e586c73ac5fe39fef7b916d5987f2b
Time: 2020-02-12
Author: zane.selvans@catalyst.coop
File Name: src/pudl/output/eia860.py
Class Name:
Method Name: plants_utils_eia860


Project Name: catalyst-cooperative/pudl
Commit Name: f2861df4fb33737df5d65df88b125bde088b2889
Time: 2020-01-29
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/eia.py
Class Name:
Method Name: _occurrence_consistency