Reputation: 29064
I would like to change the date format of a entire column in data frame.
My code looks like this:
fwds['fwdlookupterm'] = fwds['symbol'] + datetime.datetime.strptime(fwds['expiration_date'],'%y%m%d')
When i do so, i get an error:
TypeError: strptime() argument 1 must be string, not Series
How to resolve this error?
Current code:
fwds['fwdlookupterm'] = fwds['symbol'] + pd.to_datetime(str(fwds['expiration_date']),format= '%y%m%d')
Current error:
Name: expiration_date, Length: 1266, dtype: object' does not match format '%y%m%d'
Upvotes: 0
Views: 924