polars_arrow::compute::boolean_kleene

Function and_scalar

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

Logical ‘and’ operation on an array and a scalar value with Kleene logic

§Example

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

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