I need a column of strings, 'yyyymmdd', converted to date so I can do an operation (subtract one day) and then return the format to string. The combined method works in the line below, but seems to take considerably longer than two separate functions would. Ideas?
df['yyyymmdd-0'] = (pd.to_datetime(df.yyyymmdd, format='%Y%m%d')+ pd.DateOffset(days=0)).dt.strftime('%Y%m%d')