I'm trying to combine three fields to make a date, the year is currently string: code to change string to datetime:
f2[:,'frt_eli_year'] = pd.to_datetime(f2['frt_eli_year'].astype(str), format='%Y',errors='coerce',utc=True)
error message:
TypeError: unhashable type: 'slice'
Then code to join year, month, date:
f2[:,'test'] = pd.to_datetime(f2['frt_eli_year'].dt.year,f2['frt_eli_year'].dt.month,f2['frt_eli_year'].dt.day)
Appreciate the help, thanks!