I have loaded an excel file, and it contains some dirty data, which may have some date type data in the column level, which cause the pandas gets two extra column’s own data type as datetime, just like this: pandas column
I couldn’t find any solution to convert them, pretty much all the question and answer are talking about the data from column, nothing about the column’s own type itself.
And I am trying to cast it as string type, or even drop it.
I tried something like this df_new.filter(lambda x:isinstance(x, datetime.datetime))
, but the syntax is incorrect.
Can anyone please help me?
Jeremee is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.