I have hourly data for an entire year stored in a Pandas column that's an object dtype. The data was imported from a .CSV file with the following structure:
Date/Time,kWh
01/01 01:00:00,1.14168620105289
01/01 02:00:00,0.998495769210657
01/01 03:00:00,0.949679309420898
01/01 04:00:00,0.938080118507197
01/29 20:00:00,1.14161727165962
01/29 21:00:00,1.01263083086978
01/29 22:00:00,0.961652730472469
01/29 23:00:00,0.951211299856564
01/29 24:00:00,0.949390070561629
So the Date/Time column includes month, day, hours, minutes, and seconds. I'm trying to (1) convert that column to DateTime and (2) set the year as 2019.
I'm running into a problem with the conversion because for some strange reason, rather than the normal 24-hour range of 00:00 to 23:59, the group that coded the .CSV file choose hours ranging from 01:00 to 24:00. So when I run the following command:
cons['Date/Time'] = pandas.to_datetime(cons['Date/Time'], format=' %m/%d %H:%M:%S')
I get the following error:
ValueError: time data ' 01/01 24:00:00' does not match format ' %m/%d %H:%M:%S' (match)
I'm looking for assistance converting the column to DateTime and setting the data's year as 2019. Any help would be appreciated.