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

Before Change


        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()
    elif format in ["P", "p", "pandas", "pd"]:
        return _data


def QA_fetch_future_day(
    code,

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

    // 多种数据格式
    if format in ["P", "p", "pandas", "pd"]:
        return res
    elif format in ["json", "dict"]:
        return QA_util_to_json_from_pandas(res)
        
    elif format in ["n", "N", "numpy"]:
        return numpy.asarray(res)
    elif format in ["list", "l", "L"]:
        return numpy.asarray(res).tolist()
    else:
        print(
            "QA Error QA_fetch_index_min format parameter %s is none of  \"P, p, pandas, pd , json, dict , n, N, numpy, list, l, L, !\" "
            % format
        )
        return None


def QA_fetch_future_day(
    code,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

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: mlflow/mlflow
Commit Name: f38a634a118fe55d6f98ede2d82624f4cba38fcf
Time: 2019-09-04
Author: 39497902+dbczumar@users.noreply.github.com
File Name: mlflow/store/sqlalchemy_store.py
Class Name: SqlAlchemyStore
Method Name: get_experiment_by_name


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