I have a data set named aero I am trying to change the string dates in a given column to datetime This is the format of the strings:
In: aero['Date Local'].unique()
Out: array(['2000-01-01', '2000-01-02', '2000-01-03', ..., '2016-03-04',
'2016-03-05', '2016-03-06'], dtype=object)
So correct me if I'm wrong, but that looks like a mutable list of strings here is the code I tried:
for stuff in aero['Date Local']:
aero['Date Local'][stuff] = datetime.datetime.strptime(stuff, "%Y-%m-%d")
which yielded the error:
ValueError: ['2' '0' '0' '0' '-' '0' '1' '-' '0' '1'] not contained in the index
I've tried figuring out what that means, but to no avail. Could someone help me help me switch these strings to datetimes?