在将日期用作对象保存到木板文件中的数据框时报告的错误

发布于 2025-02-02 04:56:48 字数 517 浏览 3 评论 0原文

我正在尝试将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文