Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/pyo3-polars/pyo3-polars-derive/tests/02.rs
6939 views
1
use polars_core::error::PolarsResult;
2
use polars_core::prelude::*;
3
use pyo3_polars_derive::polars_expr;
4
5
#[polars_expr(output_type=Int32)]
6
fn horizontal_product(series: &[Series], kwargs: Option<&str>) -> PolarsResult<Series> {
7
let _ = kwargs;
8
9
let mut acc = series[0].clone();
10
for s in &series[1..] {
11
acc = (&acc * s)?
12
}
13
Ok(acc)
14
}
15
16
fn main() {}
17
18