Extract date from weirdly formatted datetime polars

import polars as pl
df = pl.DataFrame(['2023-08-01T06:13:24.448409',


So I have the following mass of code, and for some ungodly reason I cant for the death of me extract the date from those given strings.

In the following example I keep getting the error

exceptions.ComputeError: strict date parsing failed for 2 value(s) (2 unique): ["2023-08-01T06:13:24.448409", "2023-08-01T07:29:34.491027"]

Any ideas on how can I extract the string from such format of datetime? And why I get this error?

>Solution :

To parse a datetime upfront you’ll need to provide the full format (date & time) initially then retrieve the date part afterwards. Try the following format:


Leave a Reply