Histogram¶
-
class
visualife.calc.Histogram(**kwargs)¶ Bases:
objectCreates a new Histogram instance :param kwargs: see below :return: new Histogram instance
Keyword Arguments: - n_bins (
int) – number of bins of equal width; by default 100 bins will be created - range (
tuple(value,value)) – histogram range: (from, to) - width (
float) – bin width - bin_outliers (
bool) – if True, outliers will be recorded by the first and last bin of the histogram
Attributes Summary
n_binsThe number of bins (classes) of this histogram. outliersNumbers of outliers that were left outside this histogram :return: number of outliers widthWidth of each bins (class) of this histogram. Methods Summary
bin_from_to(bin_index)Returns the range of data that is included in a given bin of this histogram :param bin_index: index of a bin from 0 to n_bins-1 both inclusive :return: bin range clear()Removes all the data from this histogram counts(*args)Returns the number of counts for a given bin of this histogram, or the total number of counts if no histogram bin was provided :param args: index of a histogram bin or none to check the total counts :return: counts in a bin or in this histogram highest_bin()Returns the highest bin of this histogram :return: tuple of two: (max_bin_index, max_counts) observe(*points)Adds observation(s) to this histogram :param points: floatorlist(float)- data to be inserted into this histogram :return: NoneAttributes Documentation
-
n_bins¶ The number of bins (classes) of this histogram. Each bin has the same width :return: the number of bins
-
outliers¶ Numbers of outliers that were left outside this histogram :return: number of outliers
-
width¶ Width of each bins (class) of this histogram. Each bin has the same width :return: bin width
Methods Documentation
-
bin_from_to(bin_index)¶ Returns the range of data that is included in a given bin of this histogram :param bin_index: index of a bin from 0 to n_bins-1 both inclusive :return: bin range
-
clear()¶ Removes all the data from this histogram
-
counts(*args)¶ Returns the number of counts for a given bin of this histogram, or the total number of counts if no histogram bin was provided :param args: index of a histogram bin or none to check the total counts :return: counts in a bin or in this histogram
-
highest_bin()¶ Returns the highest bin of this histogram :return: tuple of two: (max_bin_index, max_counts)
-
observe(*points)¶ Adds observation(s) to this histogram :param points:
floatorlist(float)- data to be inserted into this histogram :return: None
- n_bins (