简体   繁体   English

OverflowError:转换为日期时间时,Python int太大而无法转换为C

[英]OverflowError: Python int too large to convert to C long when converting to datetime

I'm reading an excel file with Pandas. 我正在用Pandas阅读Excel文件。 One column has dates like this: 20160210 一栏中的日期是这样的: 20160210

I want to convert to datetime objects, so: 我想转换为日期时间对象,所以:

t = pd.to_datetime(dataframe['date'], format='%Y%m%d')

The following error arises: 出现以下错误:

OverflowError: Python int too large to convert to C long

Any idea? 任何想法?

Off-hand, I'd suspect some code that mistakenly assumes that long will be 64 bits everywhere, when on Windows compilers, it's 32 bits, even when targeting x86-64 CPUs. 临时而言,我怀疑某些代码会错误地假设long会在任何地方都是64位,而在Windows编译器上,即使是x86-64 CPU,它也是32位。

You wouldn't be doing this on Windows by any chance, possibly with Python 3.5.0? 您不会在Windows上这样做,可能是使用Python 3.5.0吗? There was a recurrence of the Y2K38 bug for Windows builds when they were adding support for nanosecond timestamp precision . 当Windows版本添加对纳秒级时间戳精度的支持时,会再次出现Y2K38错误 If that's not the case, I would suspect something wrong on Pandas' side, in the same manner. 如果不是这种情况,我会以同样的方式怀疑熊猫的一面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python错误-OverflowError:Python int太大,无法转换为C long - Python error - OverflowError: Python int too large to convert to C long Python 问题:“溢出错误:Python int 太大,无法转换为 C long” - Python Problem: “OverflowError: Python int too large to convert to C long” OverflowError Python int 太大而无法转换为 C long - OverflowError Python int too large to convert to C long Windows上的“溢出错误:Python int太大而无法转换为C long”,但不是Mac - “OverflowError: Python int too large to convert to C long” on windows but not mac OverflowError:python int太大,无法在win8上转换为C long - OverflowError:python int too large to convert to C long on win8 dateutil parse - OverflowError:Python int 太大,无法转换为 C long - dateutil parse - OverflowError: Python int too large to convert to C long 溢出错误:Python int 太大而无法转换为 C long - OverflowError: Python int too large to convert to C long OverflowError:Python int太大,无法在for循环中转换为C - OverflowError: Python int too large to convert to C long in a for loop OverflowError:Python int 太大,无法转换为 C long tensorflow 数据集 - OverflowError: Python int too large to convert to C long tensorflow datsets 将字符串转换为 int 时出现“溢出错误:Python int 太大而无法转换为 C long” - "OverflowError: Python int too large to convert to C long" when casting string to int
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM