【量化】Tushare运行问题

在尝试运行使用Tushare的量化交易代码时,遇到FutureWarning和AttributeError。错误源于pandas的版本过高,通过降低pandas版本解决了DataFrame.append()方法缺失的问题。此外,还提醒用户将frame.append替换为pandas.concat以避免未来警告。
摘要由CSDN通过智能技术生成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值