vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 20
声望: 0

不清楚csv数据格式,CsvLoader的导入功能导入CSV数据一直报错,csv数据格式模板能贴一个吗,各个字段和顺序是什么,谢谢。

Administrator
avatar
加入于:
帖子: 3810
声望: 199

请看vnpy-community公众号中,关于2.1.1发布的公告中DataManager模块使用讲解

Member
avatar
加入于:
帖子: 20
声望: 0

DataManager模块讲解的不够细致,csvload导入数据时还是报错,
Traceback (most recent call last):
File "C:\vnpy211_jqdata\vnpy\app\csv_loader\ui\widget.py", line 124, in load_data
datetime_format
File "C:\vnpy211_jqdata\vnpy\app\csv_loader\engine.py", line 138, in load
datetime_format=datetime_format,
File "C:\vnpy211_jqdata\vnpy\app\csv_loader\engine.py", line 80, in load_by_handle
dt = datetime.strptime(item[datetime_head], datetime_format)
KeyError: 'Datetime'

到底是什么问题啊 谢谢

Administrator
avatar
加入于:
帖子: 3810
声望: 199

你的CSV表头,时间那一列不是Datetime吧

Member
avatar
加入于:
帖子: 38
声望: 5

David wrote:

DataManager模块讲解的不够细致,csvload导入数据时还是报错,
Traceback (most recent call last):
File "C:\vnpy211_jqdata\vnpy\app\csv_loader\ui\widget.py", line 124, in load_data
datetime_format
File "C:\vnpy211_jqdata\vnpy\app\csv_loader\engine.py", line 138, in load
datetime_format=datetime_format,
File "C:\vnpy211_jqdata\vnpy\app\csv_loader\engine.py", line 80, in load_by_handle
dt = datetime.strptime(item[datetime_head], datetime_format)
KeyError: 'Datetime'

到底是什么问题啊 谢谢

注意表头大小写

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3