| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
RunningMean
Running mean calculator.
This class can be used to calculate the mean of elements from a list, tuple, iterable or any other data source. The mean is calculated on the fly without explicitly summing the values, so it can be used for data sets with arbitrary item count. Also capable of returning the standard deviation (also calculated on the fly)
|
|||
| __complex__(self) | ||
| __float__(self) | ||
|
__init__(n=0.0,
mean=0.0,
sd=0.0) Initializes the running mean calculator. |
||
| __int__(self) | ||
| __long__(self) | ||
|
__lshift__(RunningMean,
values) Adds the values in the given iterable to the elements from which we calculate the mean. |
||
|
__str__(self) str(x) |
||
| _get_mean(self) | ||
| _get_result(self) | ||
| _get_sd(self) | ||
|
add(RunningMean,
value,
repeat=1) Adds the given value to the elements from which we calculate the mean and the standard deviation. |
||
|
add_many(RunningMean,
values) Adds the values in the given iterable to the elements from which we calculate the mean. |
||
|
Inherited from |
|||
|
|||
|
mean the current mean |
||
|
result the current mean and standard deviation as a tuple |
||
|
sd the current standard deviation |
||
|
Inherited from |
|||
|
|||
|
|
|
|
|
<<) operator is aliased to this function, so you can
use it to add elements as well:
>>> rm=RunningMean() >>> rm << [1,2,3,4] (2.5, 1.6666666666667)
|
|
|
|
|
|
<<) operator is aliased to this function, so you can
use it to add elements as well:
>>> rm=RunningMean() >>> rm << [1,2,3,4] (2.5, 1.6666666666667)
|
|
|||
meanthe current mean
|
resultthe current mean and standard deviation as a tuple
|
sdthe current standard deviation
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Thu Feb 14 12:44:01 2008 | http://epydoc.sourceforge.net |