1

Good day,

inside my dataframe there's a column with items from type <class 'datetime.time'>. The first item contains the following data:

17:06:37.175539

When executing the following code...

hour = df['time'][0].hour

I'll be getting the expected value: 17. But when trying to execute this for my whole dataframe...

df['hour'] = df['time'].hour

...the following error occurs: 'Series' object has no attribute 'hour'!

Can someone tell me, what I'm doing wrong here?

Thanks to all of you!

finethen
  • 385
  • 1
  • 4
  • 19

0 Answers0