5b4d04de17457286fe4e5f3e0e8295db42d0f064,QUANTAXIS/QAFetch/QAQuery.py,,QA_fetch_index_min,#Any#Any#Any#Any#Any#Any#,618

Before Change


        {"_id": 0},
        batch_size=10000
    )
    if format in ["dict", "json"]:
        return [data for data in cursor]
    // for item in cursor:
    _data = pd.DataFrame([item for item in cursor])
    _data = _data.assign(datetime=pd.to_datetime(_data["datetime"]))
    // _data.append([str(item["code"]), float(item["open"]),
    // float(item["high"]), float(
    //     item["low"]), float(item["close"]), int(item["up_count"]),
    //     int(item["down_count"]), float(item["vol"]), float(item["amount"]),
    //     item["datetime"], item["time_stamp"], item["date"], item["type"]])

    // _data = DataFrame(_data, columns=[
    //     "code", "open", "high", "low", "close", "up_count", "down_count",
    //     "volume", "amount", "datetime", "time_stamp", "date", "type"])

    // _data["datetime"] = pd.to_datetime(_data["datetime"])
    _data = _data.set_index("datetime", drop=False)
    if format in ["numpy", "np", "n"]:
        return numpy.asarray(_data)
    elif format in ["list", "l", "L"]:
        return numpy.asarray(_data).tolist()

After Change



    res = pd.DataFrame([item for item in cursor])
    try:
        res = res.assign(
            volume=res.vol,
            datetime=pd.to_datetime(res.datetime)
        ).query("volume>1").drop_duplicates(["datetime",
                                             "code"]).set_index(
                                                 "datetime",
                                                 drop=False
                                             )
        // return res
    except:
        res = None
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 5b4d04de17457286fe4e5f3e0e8295db42d0f064
Time: 2020-04-05
Author: 11652964@qq.com
File Name: QUANTAXIS/QAFetch/QAQuery.py
Class Name:
Method Name: QA_fetch_index_min


Project Name: catalyst-cooperative/pudl
Commit Name: d07e9d7e5a586d20d0a5b7367f7e8dc7dfb55b95
Time: 2017-11-08
Author: zane.selvans@catalyst.coop
File Name: pudl/analysis.py
Class Name:
Method Name: yearly_sum_eia


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 4113a6a3be19167a8c551f8ae20e849ac851e52c
Time: 2019-03-25
Author: zhongjy1992@outlook.com
File Name: QUANTAXIS/QAFetch/QAQuery.py
Class Name:
Method Name: QA_fetch_index_day