PeakToPeak¶
Running peak to peak (max - min).
Attributes¶
-
max (stats.Max)
The running max.
-
min (stats.Min)
The running min.
-
p2p (float)
The running peak to peak.
Examples¶
>>> from river import stats
>>> X = [1, -4, 3, -2, 2, 4]
>>> ptp = stats.PeakToPeak()
>>> for x in X:
... print(ptp.update(x).get())
0
5
7
7
7
8
Methods¶
get
Return the current value of the statistic.
update
Update and return the called instance.
Parameters
- x (numbers.Number)