polars_arrow::compute::boolean

Function any

Source
pub fn any(array: &BooleanArray) -> bool
Available on crate feature compute_boolean only.
Expand description

Returns whether any of the values in the array are true.

Null values are ignored.

ยงExample

use polars_arrow::array::BooleanArray;
use polars_arrow::compute::boolean::any;

let a = BooleanArray::from(&[Some(true), Some(false)]);
let b = BooleanArray::from(&[Some(false), Some(false)]);
let c = BooleanArray::from(&[None, Some(false)]);

assert_eq!(any(&a), true);
assert_eq!(any(&b), false);
assert_eq!(any(&c), false);