pandas不可哈希化问题,unhashable type: ‘pandas._libs.tslibs.offsets.Hour

在使用MXNET中Gluonts进行深度学习的时候,经常会用到pandas库对训练数据进行读取以及处理,但是pandas库的1.1.0版本及之后都不再支持时间戳的可哈希化了,笔者试了panda库的1.0.0版本2020.1时可以支持时间戳可哈希化的。详见此文,以及此文

In Pandas 1.1 the freq component of the time-stamps that we use have stopped being hashable, which means, they cannot be used as keys in dictionaries. We use this in different locations in our code base.

We now have two options:

open an issue with pandas, requesting that the old behaviour is restored
change our code to not make use of this feauture

使用pandas1.1.0及之后版本对时间戳数据进行处理,进行深度神经网络训练时就会报错错误代码"unhashable type: 'pandas._libs.tslibs.offsets.Hour",使用 pip install -U pandas==1.0.0 重新安装低版本的pandas即可解决此问题。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值