Function polars_arrow::compute::boolean_kleene::any
source · pub fn any(array: &BooleanArray) -> Option<bool>
Available on crate feature
compute_boolean_kleene
only.Expand description
Returns whether any of the values in the array are true
.
The output is unknown (None
) if the array contains any null values and
no true
values.
§Example
use polars_arrow::array::BooleanArray;
use polars_arrow::compute::boolean_kleene::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), Some(true));
assert_eq!(any(&b), Some(false));
assert_eq!(any(&c), None);