Use pd.to_datetime
with parameter errors='coerce'
to make non-dates into NaT
null values. Then you can drop those rows
df['Date'] = pd.to_datetime(df['Date'], errors='coerce')
df = df.dropna(subset=['Date'])
df
Use pd.to_datetime
with parameter errors='coerce'
to make non-dates into NaT
null values. Then you can drop those rows
df['Date'] = pd.to_datetime(df['Date'], errors='coerce')
df = df.dropna(subset=['Date'])
df
For further actions, you may consider blocking this person and/or reporting abuse
Michael Andreuzza -
Sohaib Ilyas -
Hitesh Chauhan -
Certera -
Top comments (0)