I am lost at the mutable references ... Trying to send a DataFrame into a function ... change it and see the changes after the function call completes ...
I get error:
cannot borrow as mutable
Here is a code sample:
use polars::prelude::*;
use std::ops::DerefMut;
fn main() {
let mut days = df!(
"date_string" => &["1900-01-01", "1900-01-02", "1900-01-03", "1900-01-04", "1900-01-05",
"1900-01-06", "1900-01-07", "1900-01-09", "1900-01-10"])
.unwrap();
change(&mut days);
println!("{:?}", days);
}
fn change(days: &mut DataFrame) {
days.column("date_string").unwrap().rename("DATE-STRING)");
}