在将日期用作对象保存到木板文件中的数据框时报告的错误
我正在尝试将date
作为列作为parquet文件的数据框架保存。 date
系列是对象
的类型。
在一台计算机上,没有问题(pandas
版本为1.4.2,fastparquet
版本为0.7.2)。但是,当我在另一台计算机上尝试过它(带有相同版本的熊猫和fastparquet)时,有这样的错误。
ValueError: Can't inter object conversion type:
0 2016-01-01
1 2016-02-01
2 2016-03-01
我做了一些研究,看来date
的类型必须从对象
转换为dateTime
。但是,如果是这样,为什么它可以在我以前的计算机上使用。是否有任何方法可以解决此问题并将日期
保留为dtype
?谢谢。
I'm trying to save a dataframe with Date
as a column as parquet file. The Date
series is in the type of object
.
On one computer, there is no problems (pandas
version is 1.4.2, fastparquet
version is 0.7.2). However, when I tried it on another computer (with the same version of pandas and fastparquet), error was reported like this.
ValueError: Can't inter object conversion type:
0 2016-01-01
1 2016-02-01
2 2016-03-01
I did some research, it seems that the type of Date
has to be converted from object
to datetime
. However, if so, why does it work on my previous computer. Are there any ways to fix this issue and keep Date
as dtype
? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论