【发布时间】:2017-02-15 18:41:40
【问题描述】:
我在 Googlespeedsheet 中有一个变量 ['date_hiring'],格式类似于
16.01.2016
我在 Python 中导入它,变量有一个对象类型。我尝试转换为日期时间
from datetime import datetime
data['date_hiring'] = pd.to_datetime(data['date_hiring'])
我得到了
OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 16-01-06 00:00:00
我从这个pandas out of bounds nanosecond timestamp after offset rollforward plus adding a month offset 知道
由于 pandas 以纳秒分辨率表示时间戳,因此 可以使用 64 位整数表示的时间跨度限制为 大约 584 年
但在 Googlespeedsheet 的原始数据中,我没有像“16.01.06”这样的数据
就像'16.06.2006'
所以问题在于转换
如何改进?
【问题讨论】: