如何从系列中提取小时

时间:2018-08-22 09:01:10

标签: python python-3.x pandas

我试图从系列列中提取一天中的时间。

我的数据如下:

Unique Key  Created Date
32305299    2016-01-01 00:00:09

“创建日期”是哪个系列:

type(df['Created Date'])
pandas.core.series.Series

我在下面尝试过,但是没有用:

df['Created Date'].dt.hour

错误消息:

AttributeError: Can only use .dt accessor with datetimelike values

在这种情况下,如何提取一天中的小时?谢谢!

0 个答案:

没有答案