I am struggling with Rust Polars ...
In Pandas its fairly straight forward ... using Polars in Rust ... is another story;
Here is what I like to do (not working code):
use polars::prelude::*;
fn main() {
let days_data = df!("weekday" => &["Tuesday", "Wednesday", "Thursday", "Friday"],
"date" => &["1900-01-02", "1900-01-03", "1900-01-04", "1900-01-05"]);
let sales_data = df!("sales" => &[1_000u32, 20, 300, 40_000, 555],
"rep" => &["Joe", "Mary", "Robert", "Thomas", "Susanna"],
"date" => &["1900-01-02", "1900-01-03", "1900-01-04", "1900-01-05"]);
// here is what I like to do in pseudo code:
// Q1: How do I iterate over a column ?
for each_date in days_data["date"]{
// Q2 how do I access a specific value in Series/DataFrame?
let sales = sales_data[each_date]["sales"].value;
let rep =sales_data[each_date]["rep"].value;
let weekday = days_data[each_date]["weekday"];
if sales > 10_000 {println!("Nice Job {} and all this on a {}!", rep, weekday)};
}
}
I was looking for a couple days, but was not able o find anything close to a solution ...