Jan-19-2018, 10:37 AM
(Jan-15-2018, 03:59 PM)snippsat Wrote:>>> from datetime import datetime >>> d = ['11-01-2018'] >>> datetime.strptime(d, '%d-%m-%Y') Traceback (most recent call last): File "<string>", line 301, in runcode File "<interactive input>", line 1, in <module> TypeError: strptime() argument 1 must be str, not list # Fix >>> datetime.strptime(d[0], '%d-%m-%Y') datetime.datetime(2018, 1, 11, 0, 0)You see that this generate the same error except it's a list, i fix it be taking the string out list using index. For Pandas Series object there is a pandas.Series.to_string
thanks for info, i changed the input format before loading to it. :)