running_statistics
running_statistics(x, state=None)Streaming summary statistics.
Accumulates count, extremes, and the first four moments over one or more chunks of data, mirroring the C# RunningStatistics class. The accumulator state travels in the return value, so a chunked run holds no C++ state.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| x | array_like | The next chunk of data. | required |
| state | RunningStatistics | A :class:RunningStatistics from a previous call, or None (the default) to start a fresh accumulator. |
None |
Returns
| Name | Type | Description |
|---|---|---|
| RunningStatistics |
Examples
>>> from corehydropy import running_statistics
>>> s = running_statistics([1, 2, 3])
>>> s = running_statistics([4, 5, 6], state=s)
>>> s.n
6.0
>>> s.mean
3.5