pyarrow.compute.array_filter

pyarrow.compute.array_filter(array, selection_filter, *, memory_pool=None, options=None, null_selection_behavior='drop')

Filter with a boolean selection filter.

The output is populated with values from the input array at positions where the selection filter is non-zero. Nulls in the selection filter are handled based on FilterOptions.

Parameters
  • array (Array-like) – Argument to compute function

  • selection_filter (Array-like) – Argument to compute function

  • memory_pool (pyarrow.MemoryPool, optional) – If not passed, will allocate memory from the default memory pool.

  • options (pyarrow.compute.FilterOptions, optional) – Parameters altering compute function semantics.

  • null_selection_behavior (optional) – Parameter for FilterOptions constructor. Either options or null_selection_behavior can be passed, but not both at the same time.