I need to add 1 day to each date I want to get the begining date of the following month eg 2014-01-2014 for the 1st item in the dataframe. Tried:
montdist[\
One quick mention. if you are using data-frames and your datatype is datetime64[ns]
non indexed, Then I would go as below:
Assuming the date column name is 'Date to Change by 1' and you want to change all dates by 1 day.
import time
from datetime import datetime, timedelta, date, time
before
['Date to Change by 1'] = 1/31/2020
df['Date to Change by 1'] = (pd.to_datetime(df['Date to Change by 1']) +
timedelta(1)
After
['Date to Change by 1'] = 2/01/2020