0

I have below dataframe where the first column is without any header. and I need to add 14 days to each value in that column. How can I do it?

                               L122.Y          5121.Y       110.Y  
2021-08-30 14:00:00             0.0             0.0       35.778441   
2021-08-30 15:00:00             0.0             0.0       35.741066   
2021-08-30 16:00:00             0.0             0.0       35.737846 
ZZZSharePoint
  • 981
  • 5
  • 19

1 Answers1

1

I think first column is called index, test it:

print (df.index)

If need convert it to DatetimeIndex and add days use:

df.index = pd.to_datetime(df.index) + pd.Timedelta('14 days')

If already DatetimeIndex:

df.index += pd.Timedelta('14 days')
jezrael
  • 729,927
  • 78
  • 1,141
  • 1,090