polars_compute::arity

Function prim_unary_values

Source
pub fn prim_unary_values<I, O, F>(
    arr: PrimitiveArray<I>,
    op: F,
) -> PrimitiveArray<O>
where I: NativeType, O: NativeType, F: Fn(I) -> O,
Expand description

Applies a function to all the values (regardless of nullability).

May reuse the memory of the array if possible.