I am trying to add hours
to specific values in a pandas df
so that they are consistent.
For the df
below I want to add 24 hours
to the first value.
import pandas as pd
d = ({
'time' : ['3:00:00','27:30:00','28:00:00'],
})
df = pd.DataFrame(data=d)
I'm using this at the moment.
df['time'].iloc[0] = df['time'].iloc[0] + pd.Timedelta(hours=24)
But it produces:
time
0 1 days 03:00:00
1 27:30:00
2 28:00:00
My intended output is:
time
0 27:00:00
1 27:30:00
2 28:00:00