I am trying to convert a str column in the DataFrame into Date format of YYYY-MM-DD. How to convert different date format into one format of YYYY-MM-DD?
import polars as pl
s = pl.Series("date",["Sun Jul 8 00:34:60 2001", "12Mar2022", "12/Mar/2022"])
df = s.to_frame().with_columns(pl.col("date").str.to_date("%d%m%Y", strict=False))
shape: (3, 1)
┌──────┐
│ date │
│ --- │
│ date │
╞══════╡
│ null │
│ null │
│ null │
└──────┘