Skip to main content

Column.iif

iifwhen_truewhen_false

Group: Logical
Aliases: if

Documentation

Replaces True values with when_true and False with when_false. Only meant for use with boolean columns.

Arguments

  • when_true: value or column when self is True.
  • when_false: value or column when self is False.

Examples

If the value in a column is True, replace it with 1, otherwise 0.

      import Standard.Examples

example_if = Examples.bool_column_1.iif 1 0