gs_quant.timeseries.algebra.filter_ — gs_quant 0.1 documentation

# gs_quant.timeseries.algebra.filter_

`filter_`(x, operator=None, value=None)

  Removes values where comparison with the operator and value combination results in true, defaults to removing missing values from the series

  Parameters

    - x (`Series`) – timeseries

    - operator (`Optional`[`FilterOperator`]) – FilterOperator describing logic for value removal, e.g ‘less_than’

    - value (`Optional`[`Real`]) – number indicating value(s) to remove from the series

  Return type

    `Series`

  Returns

    timeseries with specified values removed

  Usage

  Remove each value determined by operator and value from timeseries where that expression yields true

  Examples

  Remove 0 from time series

      >>> prices = generate_series(100)
      >>> filter_(prices, FilterOperator.EQUALS, 0)

  Remove positive numbers from time series

      >>> prices = generate_series(100)
      >>> filter_(prices, FilterOperator.GREATER, 0)

  Remove missing values from time series

      >>> prices = generate_series(100)
      >>> filter_(prices)