AI量化实验室

 找回密码
 立即注册
查看: 185|回复: 6

求助:全球大类 - 单因子回测,数据好像有问题?

[复制链接]

1

主题

3

帖子

23

积分

量化新人

积分
23
发表于 7 天前 | 显示全部楼层 |阅读模式
本帖最后由 rick 于 2024-9-12 13:43 编辑

请问这是为啥呢:5.9的最新版本,运行 quantlab5.9\策略集\全球大类资产-单因子回测.ipynb 的时候显示时间戳的key不存在。


完整日志:
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File index.pyx:609, in pandas._libs.index.DatetimeEngine.get_loc()

File pandas\\_libs\\hashtable_class_helper.pxi:2606, in pandas._libs.hashtable.Int64HashTable.get_item()

File pandas\\_libs\\hashtable_class_helper.pxi:2630, in pandas._libs.hashtable.Int64HashTable.get_item()

KeyError: 1262563200000000000

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
File g:\Codes_in_Using\conda_envs\quantlab\lib\site-packages\pandas\core\indexes\base.py:3805, in Index.get_loc(self, key)
   3804 try:
-> 3805     return self._engine.get_loc(casted_key)
   3806 except KeyError as err:

File index.pyx:577, in pandas._libs.index.DatetimeEngine.get_loc()

File index.pyx:611, in pandas._libs.index.DatetimeEngine.get_loc()

KeyError: Timestamp('2010-01-04 00:00:00')

The above exception was the direct cause of the following exception:
...
    630     return Index.get_loc(self, key)
    631 except KeyError as err:
--> 632     raise KeyError(orig_key) from err

KeyError: Timestamp('2010-01-04 00:00:00')


Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

×

1

主题

3

帖子

23

积分

量化新人

积分
23
 楼主| 发表于 7 天前 | 显示全部楼层
另外这个路径没更新,有个小bug,老大可以改改,path最新值为:'quotes'

全球大类资产-时间序列分析-风险平价-月度再平衡.ipynb

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

×

61

主题

135

帖子

531

积分

管理员

积分
531
发表于 6 天前 | 显示全部楼层
rick 发表于 2024-9-12 13:48
另外这个路径没更新,有个小bug,老大可以改改,path最新值为:'quotes'

全球大类资产-时间序列分析-风险 ...

path='quotes'

61

主题

135

帖子

531

积分

管理员

积分
531
发表于 6 天前 | 显示全部楼层
这个numpy版本问题。
numpy==1.23.0

1

主题

3

帖子

23

积分

量化新人

积分
23
 楼主| 发表于 6 天前 | 显示全部楼层
ailabx 发表于 2024-9-13 09:12
这个numpy版本问题。
numpy==1.23.0

我用pip list看了这个,版本是一样的。后来干脆把那部分NaN值给填上就不报错了。
不过在 quantlab5.9\策略集\Deap——全球大类资产因子挖掘.ipynb 里面也遇到了类似的问题,挖掘到一半就报错了。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

×

61

主题

135

帖子

531

积分

管理员

积分
531
发表于 6 天前 | 显示全部楼层
numpy的版本问题。

61

主题

135

帖子

531

积分

管理员

积分
531
发表于 6 天前 | 显示全部楼层
上次有同学反馈过,更新了环境就好了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

AI量化实验室 ( 京ICP备16049031号-2 )

GMT+8, 2024-9-19 23:49 , Processed in 0.069185 second(s), 19 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表