python-igraph API reference

List of all classes, functions and methods in python-igraph

class documentation

class RunningMean:

View In Hierarchy

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)

Method __init__ RunningMean(items=None, n=0.0, mean=0.0, sd=0.0)
Method add RunningMean.add(value, repeat=1)
Method add_many RunningMean.add(values)
Method clear Resets the running mean calculator.
Property result Returns the current mean and standard deviation as a tuple
Property mean Returns the current mean
Property sd Returns the current standard deviation
Property var Returns the current variation
Method __repr__ Undocumented
Method __str__ Undocumented
Method __float__ Undocumented
Method __int__ Undocumented
Method __complex__ Undocumented
Method __len__ Undocumented
Instance Variable _nitems Undocumented
Instance Variable _mean Undocumented
Instance Variable _sqdiff Undocumented
Instance Variable _sd Undocumented
def __init__(self, items=None, n=0.0, mean=0.0, sd=0.0):

RunningMean(items=None, n=0.0, mean=0.0, sd=0.0)

Initializes the running mean calculator.

There are two possible ways to initialize the calculator. First, one can provide an iterable of items; alternatively, one can specify the number of items, the mean and the standard deviation if we want to continue an interrupted calculation.

Parametersitemsthe items that are used to initialize the running mean calcuator. If items is given, n, mean and sd must be zeros.
nthe initial number of elements already processed. If this is given, items must be None.
meanthe initial mean. If this is given, items must be None.
sdthe initial standard deviation. If this is given, items must be None.
_nitems =

Undocumented

_mean =

Undocumented

_sqdiff =

Undocumented

_sd =

Undocumented

def add(self, value, repeat=1):

RunningMean.add(value, repeat=1)

Adds the given value to the elements from which we calculate the mean and the standard deviation.

Parametersvaluethe element to be added
repeatnumber of repeated additions
def add_many(self, values):

RunningMean.add(values)

Adds the values in the given iterable to the elements from which we calculate the mean. Can also accept a single number. The left shift (<<) operator is aliased to this function, so you can use it to add elements as well:

>>> rm=RunningMean()
>>> rm << [1,2,3,4]
>>> rm.result               # doctest:+ELLIPSIS
(2.5, 1.290994...)
Parametersvaluesthe element(s) to be added (type: iterable)
def clear(self):

Resets the running mean calculator.

@property
result =

Returns the current mean and standard deviation as a tuple

@property
mean =

Returns the current mean

@property
sd =

Returns the current standard deviation

@property
var =

Returns the current variation

def __repr__(self):

Undocumented

def __str__(self):

Undocumented

def __float__(self):

Undocumented

def __int__(self):

Undocumented

def __complex__(self):

Undocumented

def __len__(self):

Undocumented

API Documentation for python-igraph, generated by pydoctor 21.2.2 at 2021-10-18 16:11:46.