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
Pascal Kleindienst -
Pascal Kleindienst -
Lucky Singh Chauhan -
High Octane -
Top comments (0)