Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
:timing
:sccache 1
:dep polars = { version = "0.21.1", features = ["lazy", "parquet"] }use polars::prelude::*;ChunkedArray¶
Series¶
let s: Series = [10, 20, 30].iter().collect();
sshape: (3,)
Series: '' [i32]
[
10
20
30
]s.len()3s.get(2)Int32(30)match s.get(2) {
AnyValue::Int32(x) => x,
_ => panic!(),
}30Convert a Series to a ChunkedArray.
{
let ca = s.i32().unwrap();
ca
}shape: (3,)
ChunkedArray: '' [Int32]
[
10
20
30
]Get the first element of the ChunkedArray.
{
let ca = s.i32().unwrap();
ca.get(0)
}Some(10)