I have a data frame with a column with number of dates since year 1900. I need to change the format to Y%m%d. For this I created a column datetime.date(1900,1,1) to which try to sum the number of days.
I am receiving this error:
TypeError: unsupported operand type(s) for +: 'numpy.ndarray' and 'TimedeltaIndex'
This is my code:
df_vend['creation_date'] = np.where(df_vend['creation_date'] == 0,1,df_vend['creation_date'])
df_vend['base_date'] = [datetime.date(2019,1,1)] * len(df_vend.creation_date)
df_vend['creation_date'] = df_vend['base_date'] + pd.to_timedelta(df_vend['creation_date'])
np.where is used to change dates with value 0.