0

I have a pandas data frame where the the column 'Date_Time' holds a date time combo in the format 'datetime.datetime'.

I have converted my pandas dataframe into a dictionary using the 'to_dict' method. However the components are this Date_Time column are coming up like so in the python dictionary:

datetime.datetime(2021, 10, 17, 7, 23, 12)

I have been looking around to see if I can convert this to a string somehow, but it is confusing me because it is a datetime.datetime object. I think the best thing to do is to go to my df['Date_Time'] column and set this as a string. But how do I do this if its a datetime.datetime object.

kitchen800
  • 73
  • 8
  • 29

0 Answers0