polars_arrow::compute::arity_assign

Function binary

Source
pub fn binary<T, D, F>(
    lhs: &mut PrimitiveArray<T>,
    rhs: &PrimitiveArray<D>,
    op: F,
)
where T: NativeType, D: NativeType, F: Fn(T, D) -> T,
Expand description

Applies a binary function to two PrimitiveArrays, optionally in-place, returning a new PrimitiveArray.

§Implementation

This function tries to apply the function directly to the values of the array. If that region is shared, this function creates a new region and writes to it.

§Panics

This function panics iff

  • the arrays have a different length.
  • the function itself panics.