gs_quant.timeseries.algebra.if_ — gs_quant 0.1 documentation

# gs_quant.timeseries.algebra.if_

`if_`(flags, x, y)

  Returns a series s. For i in the index of flags, s[i] = x[i] if flags[i] == 1 else y[i].

  Parameters

    - flags (`Series`) – series of 1s and 0s

    - x (`Union`[`Series`, `float`]) – values to use when flag is 1

    - y (`Union`[`Series`, `float`]) – values to use when flag is 0

  Return type

    `Series`

  Returns

    result series