In Rust Polars, how to cast a Series or ChunkedArray to a Vec?
In Rust Polars, how to cast a Series or ChunkedArray to a Vec?
You can collect the values into a Vec.
use polars::prelude::*;
fn main() -> Result<()> {
let s = Series::new("a", 0..10i32);
let as_vec: Vec<Option<i32>> = s.i32()?.into_iter().collect();
// if we are certain we don't have missing values
let as_vec: Vec<i32> = s.i32()?.into_no_null_iter().collect();
Ok(())
}