datatable.ifelse()¶
Produce a column that chooses one of the two values based on the condition.
This function will only compute those values that are needed for
the result. Thus, for each row we will evaluate either expr_if_true
or expr_if_false (based on the condition value) but not both.
This may be relevant for those cases
Parameters¶
condition
FExprAn expression yielding a single boolean column.
expr_if_true
FExprValues that will be used when the condition evaluates to True. This must be a single column.
expr_if_false
FExprValues that will be used when the condition evaluates to False. This must be a single column.
return
FExprThe resulting expression is a single column whose stype is the
stype which is common for expr_if_true and expr_if_false,
i.e. it is the smallest stype into which both exprs can be
upcasted.