python-igraph API reference

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

class documentation

class Histogram(object):

View In Hierarchy

Generic histogram class for real numbers

Example:

>>> h = Histogram(5)     # Initializing, bin width = 5
>>> h << [2,3,2,7,8,5,5,0,7,9]     # Adding more items
>>> print(h)
N = 10, mean +- sd: 4.8000 +- 2.9740
[ 0,  5): **** (4)
[ 5, 10): ****** (6)
Method __init__ Initializes the histogram with the given data set.
Property n Returns the number of elements in the histogram
Property mean Returns the mean of the elements in the histogram
Property sd Returns the standard deviation of the elements in the histogram
Property var Returns the variance of the elements in the histogram
Method add Adds a single number to the histogram.
Method add_many Adds a single number or the elements of an iterable to the histogram.
Method clear Clears the collected data
Method bins Generator returning the bins of the histogram in increasing order
Method __plot__ Plotting support
Method to_string Returns the string representation of the histogram.
Method __str__ Undocumented
Instance Variable _bin_width Undocumented
Instance Variable _bins Undocumented
Instance Variable _min Undocumented
Instance Variable _max Undocumented
Instance Variable _running_mean Undocumented
Method _get_bin Returns the bin index corresponding to the given number.
def __init__(self, bin_width=1, data=None):

Initializes the histogram with the given data set.

Parametersbin_widththe bin width of the histogram.
datathe data set to be used. Must contain real numbers.
_bin_width =

Undocumented

_bins =

Undocumented

(type: list)
_min =

Undocumented

_max =

Undocumented

_running_mean =

Undocumented

def _get_bin(self, num, create=False):

Returns the bin index corresponding to the given number.

Parametersnumthe number for which the bin is being sought
createwhether to create a new bin if no bin exists yet.
Returnsthe index of the bin or None if no bin exists yet and {create} is False.
@property
n =

Returns the number of elements in the histogram

@property
mean =

Returns the mean of the elements in the histogram

@property
sd =

Returns the standard deviation of the elements in the histogram

@property
var =

Returns the variance of the elements in the histogram

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

Adds a single number to the histogram.

Parametersnumthe number to be added
repeatnumber of repeated additions
def add_many(self, data):

Adds a single number or the elements of an iterable to the histogram.

Parametersdatathe data to be added
def clear(self):

Clears the collected data

def bins(self):

Generator returning the bins of the histogram in increasing order

Returnsa tuple with the following elements: left bound, right bound, number of elements in the bin
def __plot__(self, context, bbox, _, **kwds):

Plotting support

def to_string(self, max_width=78, show_bars=True, show_counts=True):

Returns the string representation of the histogram.

Parametersmax_widththe maximal width of each line of the string This value may not be obeyed if it is too small.
show_barsspecify whether the histogram bars should be shown
show_countsspecify whether the histogram counts should be shown. If both show_bars and show_counts are False, only a general descriptive statistics (number of elements, mean and standard deviation) is shown.
def __str__(self):

Undocumented

API Documentation for python-igraph, generated by pydoctor 21.2.2 at 2021-03-26 11:21:53.