89b43bbd55550d5c103a8b06281d9bc62e533680,QUANTAXIS/QAData/data_resample.py,,QA_data_min_resample,#Any#Any#,348

Before Change


    

    try:
        min_data = min_data.reset_index().set_index("datetime", drop=False)
    except:
        min_data = min_data.set_index("datetime", drop=False)

    CONVERSION = {
        "code": "first",
        "open": "first",
        "high": "max",
        "low": "min",
        "close": "last",
        "vol": "sum",
        "amount": "sum"
    } if "vol" in min_data.columns else {
        "code": "first",
        "open": "first",
        "high": "max",
        "low": "min",
        "close": "last",
        "volume": "sum",
        "amount": "sum"
    }
    resx = pd.DataFrame()

    for item in set(min_data.index.date):
        min_data_p = min_data.loc[str(item)]
        n = min_data_p["{} 21:00:00".format(item):].resample(
            type_,

After Change


    }
    min_data = min_data.loc[:, list(CONVERSION.keys())]
    idx = min_data.index
    part_1 = min_data.iloc[idx.indexer_between_time("9:30", "11:30")]
    part_1_res = part_1.resample(
        type_,
        base=30,
        closed="right",
        loffset=type_
    ).apply(CONVERSION)
    part_2 = min_data.iloc[idx.indexer_between_time("13:00", "15:00")]
    part_2_res = part_2.resample(
        type_,
        base=0,
        closed="right",
        loffset=type_
    ).agg(CONVERSION)
    return pd.concat([part_1_res, part_2_res]).dropna().sort_index().reset_index().set_index(["datetime", "code"])


Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 89b43bbd55550d5c103a8b06281d9bc62e533680
Time: 2019-08-05
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/data_resample.py
Class Name:
Method Name: QA_data_min_resample


Project Name: J535D165/recordlinkage
Commit Name: 0fe6aafe48a44cf8ec6f5a86ac3d212622074150
Time: 2018-03-10
Author: jonathandebruinhome@gmail.com
File Name: recordlinkage/index.py
Class Name: SortedNeighbourhood
Method Name: _link_index


Project Name: J535D165/recordlinkage
Commit Name: 0fe6aafe48a44cf8ec6f5a86ac3d212622074150
Time: 2018-03-10
Author: jonathandebruinhome@gmail.com
File Name: recordlinkage/index.py
Class Name: Block
Method Name: _link_index