I am looping through folder to create json objects of all the excel-files there. This works fine for most of the files besides some that comes with a different dateformat. Some comes with an empty line which is okay. The script worked. However, when it comes as a new type of dateformat it fails with error:
TypeError: argument of type 'Timestamp' is not iterable
datelist =[]
for col in data.columns:
if col == str("PriceDate"):
for val in data[col]:
if "\n" in val:
val = "".join(val.split())
val = datetime.strptime(val, '%Y-%m-%d')
val = val.strftime('%d/%m/%Y')
datelist.append(val)
How can I solve this?