Python
All Top Python Interview Questions#25
Parse Ambiguous Date Formats with pd.to_datetime in Pandas
MediumInterview Question #25
Given a noisy date column with mixed formats and corrupt text like `'2026-01-15'`, `'15/02/2026'`, and `'UNKNOWN'`, parse them into datetime and isolate corrupt records.
Input Table: df
2 rows preview| raw_date |
|---|
| 2026-01-15 |
| UNKNOWN_DATE |
Expected Output Structure2 rows
| parsed_date |
|---|
| 2026-01-15 00:00:00 |
| NULL |
Interview Context
Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.
Python 3.10 (Pandas)
Environment Ready
Starting the real Python + pandas runtime (one-time download)…