Tushare很久没有重新安装环境了,今天运行了下,发现如下错误
cjl@cjl-Virtual-Machine:~/workspace/stock_assist/fetcher$ python test_fetcher.py
[Getting data:]#/home/cjl/.local/lib/python3.10/site-packages/tushare/stock/trading.py:135: FutureWarning: Passing literal json to 'read_json' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.
df = pd.DataFrame(pd.read_json(js, dtype={'code':object}),
#/home/cjl/.local/lib/python3.10/site-packages/tushare/stock/trading.py:135: FutureWarning: Passing literal json to 'read_json' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.
df = pd.DataFrame(pd.read_json(js, dtype={'code':object}),
Traceback (most recent call last):
File "/home/cjl/workspace/stock_assist/fetcher/test_fetcher.py", line 25, in <module>
main()
File "/home/cjl/w

在尝试运行使用Tushare的量化交易代码时,遇到FutureWarning和AttributeError。错误源于pandas的版本过高,通过降低pandas版本解决了DataFrame.append()方法缺失的问题。此外,还提醒用户将frame.append替换为pandas.concat以避免未来警告。
最低0.47元/天 解锁文章
347

被折叠的 条评论
为什么被折叠?



