I am converting the date column to pandas date, date column have date with time, some are invalid entry for that I am ignoring that. Date column looks like this image with some nat value enter image description here
I am using below code
df['datePublished']=pd.to_datetime(df['datePublished'], errors="coerce")
df_1 = df[df['datePublished'] >= '2022-01-01']
Error message:
TypeError: '>=' not supported between instances of 'datetime.datetime' and 'str'
How to convert the different dates in a column into pandas date?
df_1=df[df['datePublished'].ge(pd.Timestamp('2022-01-01')]?