gs_quant.timeseries.analysis.count — gs_quant 0.1 documentation

# gs_quant.timeseries.analysis.count

`count`(x)

  Count observations in series

  Parameters

    x (`Series`) – time series

  Return type

    `Series`

  Returns

    number of observations

  Usage

  Count the number of valid observations in a series:

  \(R_t = R_{t-1} + 1\)

  if \(X_t\) is not NaN, and

  \(R_t = R_{t-1} + 0\)

  if \(X_t\) is NaN

  Examples

  Count observations in series:

      >>> series = generate_series(100)
      >>> count = count(series)

  See also

  `sum()`