ibis.case¶
-
ibis.
case
()¶ Similar to the .case method on array expressions, create a case builder that accepts self-contained boolean expressions (as opposed to expressions which are to be equality-compared with a fixed value expression)
Use the .when method on the resulting object followed by .end to create a complete case.
Examples
>>> import ibis >>> cond1 = ibis.literal(1) == 1 >>> cond2 = ibis.literal(2) == 1 >>> result1 = 3 >>> result2 = 4 >>> expr = (ibis.case() ... .when(cond1, result1) ... .when(cond2, result2).end())
- Returns
case
- Return type
CaseBuilder