我有一个看起来像这样的数据框
df
[output]:
date time
2020-02-28 00:30:45
2020-02-28 00:30:45
2020-03-09 00:21:06
2020-03-09 00:21:06
2020-03-09 00:21:06
跟随,用
df.time.dtype
[output]: dtype('<m8[ns]')
我想用以下命令从时间变量中提取分钟数。df.time.dt.minute
但是,我遇到了这个错误:
AttributeError: 'TimedeltaProperties' 对象没有 'minute' 属性
有人知道如何解决这个问题吗?