Function arrow::compute::kernels::filter::filter[][src]

pub fn filter(array: &dyn Array, predicate: &BooleanArray) -> Result<ArrayRef>
Expand description

Filters an Array, returning elements matching the filter (i.e. where the values are true).

Example

let array = Int32Array::from(vec![5, 6, 7, 8, 9]);
let filter_array = BooleanArray::from(vec![true, false, false, true, false]);
let c = filter(&array, &filter_array)?;
let c = c.as_any().downcast_ref::<Int32Array>().unwrap();
assert_eq!(c, &Int32Array::from(vec![5, 8]));