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)
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: QUANTAXIS/QUANTAXIS
Commit Name: d0bfaa2292ccc5acd63c2374f03a6ef92bfd851c
Time: 2017-12-09
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAFetch/QATdx.py
Class Name:
Method Name: select_best_ip
Project Name: bokeh/bokeh
Commit Name: ee8dcf2a4be946bdcf2d1d4afe2cb74480003a71
Time: 2016-08-20
Author: github@birdsbits.com
File Name: examples/plotting/file/unemployment.py
Class Name:
Method Name: