python pandas Timestamp 转为 datetime 类型

In [11]: ts = pd.Timestamp('2014-01-23 00:00:00', tz=None) 
In [12]: ts.to_pydatetime() Out[12]: datetime.datetime(2014, 1, 23, 0, 0)

It's also available on a DatetimeIndex:

In [13]: rng = pd.date_range('1/10/2011', periods=3, freq='D') 
In [14]: rng.to_pydatetime() Out[14]: array([datetime.datetime(2011, 1, 10, 0, 0), datetime.datetime(2011, 1, 11, 0, 0), datetime.datetime(2011, 1, 12, 0, 0)], dtype=object)

转载于:https://www.cnblogs.com/qingyuanjushi/p/9255003.html

你可能感兴趣的:(python pandas Timestamp 转为 datetime 类型)