5c34d497ab32ea731b687c5863f104615f666d06,QUANTAXIS/QAFetch/QAQuery.py,,QA_fetch_index_min,#,286

Before Change


        frequence = "30min"
    elif frequence in ["60min", "60m"]:
        frequence = "60min"
    __data = []
    code = QA_util_code_tolist(code)
    cursor = collections.find({
        "code": {"$in": code}, "time_stamp": {
            "$gte": QA_util_time_stamp(start),
            "$lte": QA_util_time_stamp(end)
        }, "type": frequence
    }, {"_id": 0}, batch_size=10000)
    if format in ["dict", "json"]:
        return [data for data in cursor]
    for item in cursor:

        __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"]:

After Change


    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=[
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 5c34d497ab32ea731b687c5863f104615f666d06
Time: 2019-02-16
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAFetch/QAQuery.py
Class Name:
Method Name: QA_fetch_index_min


Project Name: shakedzy/dython
Commit Name: 626e587f0d5573ca973a8333cfa7f24cd5b749b7
Time: 2020-02-01
Author: shakedzy@gmail.com
File Name: dython/examples.py
Class Name:
Method Name: associations_example


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 5c34d497ab32ea731b687c5863f104615f666d06
Time: 2019-02-16
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAFetch/QAQuery.py
Class Name:
Method Name: QA_fetch_index_day