pyarrow.compute.array_filter

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

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:
arrayArray-like

Argument to compute function.

selection_filterArray-like

Argument to compute function.

null_selection_behaviorstr, default “drop”

How to handle nulls in the selection filter. Accepted values are “drop”, “emit_null”.

optionspyarrow.compute.FilterOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.