Function polars_arrow::compute::boolean::and_scalar

source ·
pub fn and_scalar(array: &BooleanArray, scalar: &BooleanScalar) -> BooleanArray
Available on crate feature compute_boolean only.
Expand description

Performs AND operation on an array and a scalar value. If either left or right value is null then the result is also null.

§Example

use polars_arrow::array::BooleanArray;
use polars_arrow::compute::boolean::and_scalar;
use polars_arrow::scalar::BooleanScalar;

let array = BooleanArray::from_slice(&[false, false, true, true]);
let scalar = BooleanScalar::new(Some(true));
let result = and_scalar(&array, &scalar);
assert_eq!(result, BooleanArray::from_slice(&[false, false, true, true]));