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 or right must be of the same type scalar/ array. null values in cond will be promoted to the output.

Parameters
  • cond (Array-like or scalar-like) – Argument to compute function

  • left (Array-like or scalar-like) – Argument to compute function

  • right (Array-like or scalar-like) – Argument to compute function

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