pyarrow.compute.if_else#

pyarrow.compute.if_else(cond,left,right,/,*,memory_pool=None)#

Choose values based on a condition.

cond must be a Boolean scalar/ array.left orright must be of the same type scalar/ array.null values incond will be promoted to the output.

Parameters:
condArray-like or scalar-like

Argument to compute function.

leftArray-like or scalar-like

Argument to compute function.

rightArray-like or scalar-like

Argument to compute function.

memory_poolpyarrow.MemoryPool, optional

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