I have a large dataframe from csv (170 cols). Many of these are date but not being read as date. I have a list of these as
date_cols = [col for col in df.columns if 'date' in col]
I want to apply a function to all those columns (13 total) How can i apply a function over that list. Attempted so far:
modDfObj = df.apply(lambda x: pd.to_datetime(x) if x.name in date_cols else x)