Closed mydvb0 closed 3 years ago
批量读取日线数据,返回超出几倍的异常数据
调用代码如下 data = ts.pro_bar(ts_code='000001.SZ,000002.SZ,000004.SZ', adj='qfq', start_date='20210317', end_date='20210319') 股票代码是三个,日期间隔3天,应返回9行数据,结果返回27行,个股的每日数据重复三次,且开盘价格等还不一样 股票代码是两个,日期间隔3天,应返回6行数据,结果返回12行,个股的每日数据重复二次,且开盘价格等还不一样 如果股票代码是一个就没有问题
我在tushare上注册的ID号: 430306
ts_code trade_date open ... pct_chg vol amount
0 000001.SZ 20210317 21.4500 ... -2.1237 821488.65 1738185.857 1 000001.SZ 20210317 29.7275 ... -2.1237 821488.65 1738185.857 2 000001.SZ 20210317 0.7850 ... -2.1193 821488.65 1738185.857 3 000002.SZ 20210317 32.6500 ... -0.5775 718970.72 2355350.648 4 000002.SZ 20210317 45.2495 ... -0.5775 718970.72 2355350.648 5 000002.SZ 20210317 1.1949 ... -0.5731 718970.72 2355350.648 6 000004.SZ 20210317 17.3200 ... 2.4698 19183.00 33743.555 7 000004.SZ 20210317 24.0037 ... 2.4697 19183.00 33743.555 8 000004.SZ 20210317 0.6339 ... 2.4639 19183.00 33743.555 9 000001.SZ 20210318 21.3000 ... 2.5000 691610.19 1483801.548 10 000001.SZ 20210318 29.5196 ... 2.4999 691610.19 1483801.548 11 000001.SZ 20210318 0.7795 ... 2.4874 691610.19 1483801.548 12 000002.SZ 20210318 32.6000 ... -0.0306 482135.22 1580726.128 13 000002.SZ 20210318 45.1802 ... -0.0307 482135.22 1580726.128 14 000002.SZ 20210318 1.1931 ... -0.0334 482135.22 1580726.128 15 000004.SZ 20210318 17.7600 ... -1.9058 17887.06 31488.703 16 000004.SZ 20210318 24.6135 ... -1.9058 17887.06 31488.703 17 000004.SZ 20210318 0.6500 ... -1.9145 17887.06 31488.703 18 000001.SZ 20210319 21.5300 ... -5.7984 1525622.27 3159181.042 19 000001.SZ 20210319 29.8383 ... -5.7983 1525622.27 3159181.042 20 000001.SZ 20210319 0.7879 ... -5.7973 1525622.27 3159181.042 21 000002.SZ 20210319 32.5000 ... -4.5872 989922.04 3114965.955 22 000002.SZ 20210319 45.0416 ... -4.5871 989922.04 3114965.955 23 000002.SZ 20210319 1.1894 ... -4.5876 989922.04 3114965.955 24 000004.SZ 20210319 17.5000 ... 0.7429 12702.00 22341.836 25 000004.SZ 20210319 24.2532 ... 0.7426 12702.00 22341.836 26 000004.SZ 20210319 0.6404 ... 0.7495 12702.00 22341.836
[27 rows x 11 columns]
复权行情,单次只能提取一个股票,不能多个同时。你的tushare sdk升级到最新版
批量读取日线数据,返回超出几倍的异常数据
调用代码如下 data = ts.pro_bar(ts_code='000001.SZ,000002.SZ,000004.SZ', adj='qfq', start_date='20210317', end_date='20210319') 股票代码是三个,日期间隔3天,应返回9行数据,结果返回27行,个股的每日数据重复三次,且开盘价格等还不一样 股票代码是两个,日期间隔3天,应返回6行数据,结果返回12行,个股的每日数据重复二次,且开盘价格等还不一样 如果股票代码是一个就没有问题
我在tushare上注册的ID号: 430306
0 000001.SZ 20210317 21.4500 ... -2.1237 821488.65 1738185.857 1 000001.SZ 20210317 29.7275 ... -2.1237 821488.65 1738185.857 2 000001.SZ 20210317 0.7850 ... -2.1193 821488.65 1738185.857 3 000002.SZ 20210317 32.6500 ... -0.5775 718970.72 2355350.648 4 000002.SZ 20210317 45.2495 ... -0.5775 718970.72 2355350.648 5 000002.SZ 20210317 1.1949 ... -0.5731 718970.72 2355350.648 6 000004.SZ 20210317 17.3200 ... 2.4698 19183.00 33743.555 7 000004.SZ 20210317 24.0037 ... 2.4697 19183.00 33743.555 8 000004.SZ 20210317 0.6339 ... 2.4639 19183.00 33743.555 9 000001.SZ 20210318 21.3000 ... 2.5000 691610.19 1483801.548 10 000001.SZ 20210318 29.5196 ... 2.4999 691610.19 1483801.548 11 000001.SZ 20210318 0.7795 ... 2.4874 691610.19 1483801.548 12 000002.SZ 20210318 32.6000 ... -0.0306 482135.22 1580726.128 13 000002.SZ 20210318 45.1802 ... -0.0307 482135.22 1580726.128 14 000002.SZ 20210318 1.1931 ... -0.0334 482135.22 1580726.128 15 000004.SZ 20210318 17.7600 ... -1.9058 17887.06 31488.703 16 000004.SZ 20210318 24.6135 ... -1.9058 17887.06 31488.703 17 000004.SZ 20210318 0.6500 ... -1.9145 17887.06 31488.703 18 000001.SZ 20210319 21.5300 ... -5.7984 1525622.27 3159181.042 19 000001.SZ 20210319 29.8383 ... -5.7983 1525622.27 3159181.042 20 000001.SZ 20210319 0.7879 ... -5.7973 1525622.27 3159181.042 21 000002.SZ 20210319 32.5000 ... -4.5872 989922.04 3114965.955 22 000002.SZ 20210319 45.0416 ... -4.5871 989922.04 3114965.955 23 000002.SZ 20210319 1.1894 ... -4.5876 989922.04 3114965.955 24 000004.SZ 20210319 17.5000 ... 0.7429 12702.00 22341.836 25 000004.SZ 20210319 24.2532 ... 0.7426 12702.00 22341.836 26 000004.SZ 20210319 0.6404 ... 0.7495 12702.00 22341.836
[27 rows x 11 columns]