akfamily / akshare

AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
https://akshare.akfamily.xyz
MIT License
8.8k stars 1.81k forks source link

python3.8.17 交易所会员持仓排名爬取接口报错 #4944

Closed YPersion closed 1 month ago

YPersion commented 1 month ago

环境: python 3.8.17 akshare版本 1.13.73

接口:futures_dce_position_rank 报错信息: Traceback (most recent call last): File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\akshare\futures\cot.py", line 873, in futures_dce_position_rank part_one = data[start_list[0] : end_list[0]].iloc[1:, :] IndexError: list index out of range

接口:get_cffex_rank_table 报错信息: File "E:\GitRes\FuturesProject\test.py", line 40, in futures_dce_detail_dict = ak.get_cffex_rank_table(date="20240612") File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\akshare\futures\cot.py", line 769, in get_cffex_rank_table table = table.map(lambda x: x.strip() if isinstance(x, str) else x) File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\pandas\core\generic.py", line 5465, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'map'

接口:get_shfe_rank_table 报错信息: File "E:\GitRes\FuturesProject\test.py", line 40, in futures_dce_detail_dict = ak.get_shfe_rank_table(date="20240612") File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\akshare\futures\cot.py", line 337, in get_shfe_rank_table df = df.map(lambda x: x.strip() if isinstance(x, str) else x) File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\pandas\core\generic.py", line 5465, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'map'

YPersion commented 1 month ago

麻烦看一下问题 谢谢

albertandking commented 1 month ago

环境: python 3.8.17 akshare版本 1.13.73

接口:futures_dce_position_rank 报错信息: Traceback (most recent call last): File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\akshare\futures\cot.py", line 873, in futures_dce_position_rank part_one = data[start_list[0] : end_list[0]].iloc[1:, :] IndexError: list index out of range

接口:get_cffex_rank_table 报错信息: File "E:\GitRes\FuturesProject\test.py", line 40, in futures_dce_detail_dict = ak.get_cffex_rank_table(date="20240612") File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\akshare\futures\cot.py", line 769, in get_cffex_rank_table table = table.map(lambda x: x.strip() if isinstance(x, str) else x) File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\pandas\core\generic.py", line 5465, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'map'

接口:get_shfe_rank_table 报错信息: File "E:\GitRes\FuturesProject\test.py", line 40, in futures_dce_detail_dict = ak.get_shfe_rank_table(date="20240612") File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\akshare\futures\cot.py", line 337, in get_shfe_rank_table df = df.map(lambda x: x.strip() if isinstance(x, str) else x) File "D:\Anaconda\envs\env_futuresproject\lib\site-packages\pandas\core\generic.py", line 5465, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'map'

接口测试正常,安装最新版本使用