Im trying to filter a dataframe by date. But filter it with expressions like this would be really cumbersome for a date like "2019-11-01 10:15:00".
My goal is to do something like the python version:
use polars::export::chrono::NaiveDateTime;
use polars::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let df = LazyCsvReader::new(path)
.with_parse_dates(true)
.has_header(true)
.finish()?
.collect()?;
let dt = NaiveDateTime::parse_from_str("2019-11-01 10:15:00", "%Y-%m-%d %H:%M:%S")?;
//This will not compile!
let filtered = df.filter(col("time") < dt);
}
However I'm having a really hard time to filter the dateframe in-place or just creating a boolean mask.