Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于AKShare的接口get_futures_daily在条件market='INE'时获取2018年3月以前的数据出错问题 #5415

Closed
dahong38 opened this issue Dec 12, 2024 · 3 comments

Comments

@dahong38
Copy link

当前使用Python 3.13.0,AKShare版本为1.15.45,AKTools版本为0.0.89,运行环境为64位的Windows 10 终端下执行:

python

import akshare as ak
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='DCE')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='CFFEX')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='SHFE')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='GFEX')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='CZCE')

上述执行后都能正常返回数据,但执行以下条件就出错,而且不但是2018年3月份,目前试到2018年2月份的数据也获取出错:

df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='INE')
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
return self._engine.get_loc(casted_key)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas\_libs\hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'PRODUCTGROUPID'

由于上送不了截图,只能贴部分出错信息上来,不知何故,在python环境里也无法正常获取 df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='INE')的数据,不止这个日期,2017年的数据都获取出错,但目前看到是条件为market='INE'的情况下。这种情况能修复处理吗?先感谢!

@albertandking
Copy link
Collaborator

当前使用Python 3.13.0,AKShare版本为1.15.45,AKTools版本为0.0.89,运行环境为64位的Windows 10 终端下执行:

python

import akshare as ak
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='DCE')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='CFFEX')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='SHFE')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='GFEX')
df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='CZCE')

上述执行后都能正常返回数据,但执行以下条件就出错,而且不但是2018年3月份,目前试到2018年2月份的数据也获取出错:

df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='INE')
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
return self._engine.get_loc(casted_key)

File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas\_libs\hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'PRODUCTGROUPID'

由于上送不了截图,只能贴部分出错信息上来,不知何故,在python环境里也无法正常获取 df = ak.get_futures_daily(start_date='20180301', end_date='20180331', market='INE')的数据,不止这个日期,2017年的数据都获取出错,但目前看到是条件为market='INE'的情况下。这种情况能修复处理吗?先感谢!

接口测试正常

@dahong38
Copy link
Author

接口测试正常?执行以下语句试一下:目前的问题是针对market='INE'日期在2018年3月以前的数据,此接口对于交易为INE的都不正常啊?若你们测试正常,是否我的Python版本不够高产生还是什么环境没设置好?
这个语句就是执行时出错:
ak.get_futures_daily(start_date='20180301', end_date='20180331', market='INE')

@dahong38
Copy link
Author

本人当前使用环境:Python 3.13.0,AKShare版本为1.15.45,AKTools版本为0.0.89,运行环境为64位的Windows 10
执行取数的接口出错:
ak.get_futures_daily(start_date='20180301', end_date='20180331', market='INE')

@dahong38 dahong38 changed the title 关于AKShare的接口get_futures_daily获取2018年数据出错问题 关于AKShare的接口get_futures_daily在条件market='INE'时获取2018年3月以前的数据出错问题 Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants