[英]Python error - OverflowError: Python int too large to convert to C long
[英]OverflowError: Python int too large to convert to C long when converting to datetime
我正在用Pandas閱讀Excel文件。 一欄中的日期是這樣的: 20160210
我想轉換為日期時間對象,所以:
t = pd.to_datetime(dataframe['date'], format='%Y%m%d')
出現以下錯誤:
OverflowError: Python int too large to convert to C long
任何想法?
臨時而言,我懷疑某些代碼會錯誤地假設long
會在任何地方都是64位,而在Windows編譯器上,即使是x86-64 CPU,它也是32位。
您不會在Windows上這樣做,可能是使用Python 3.5.0嗎? 當Windows版本添加對納秒級時間戳精度的支持時,會再次出現Y2K38錯誤 。 如果不是這種情況,我會以同樣的方式懷疑熊貓的一面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.