| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/api/../api/../generated/pyarrow.compute.case_when.html | [Back] [Original] |
Section Navigation
Choose values based on multiple conditions.
cond must be a struct of Boolean values. cases can be a mix of scalar and array arguments (of any type, but all must be the same type or castable to a common type), with either exactly one datum per child of cond, or one more cases than children of cond (in which case we have an else value).
Each row of the output will be the corresponding value of the first datum in cases for which the corresponding child of cond is true, or otherwise the else value (if given), or null.
Essentially, this implements a switch-case or if-else, if-else statement.
Argument to compute function.
Argument to compute function.
pyarrow.MemoryPool, optionalIf not passed, will allocate memory from the default memory pool.
Copyright 2016-2026 Apache Software Foundation.
Apache Arrow, Arrow, Apache, the Apache logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Created using Sphinx 9.1.0.
Built with the PyData Sphinx Theme 0.20.0.
| Web Proxy Viewer | New URL | Original Page |