# change datetime to Datetime dtype df = df.with_columns(pl.col('datetime').cast(pl.Datetime)) print(df.head())