Histogram2D

class visualife.calc.Histogram2D(**kwargs)

Bases: object

Creates a new Histogram2D instance :param kwargs: see below :return: new Histogram2D instance

Keyword Arguments:
 
  • n_bins (int) – number of bins in both dimensions
  • n_bins_x (int) – number of bins in X dimension
  • n_bins_y (int) – number of bins in Y dimension
  • range (tuple(value,value)) – histogram range, same for both dimensions
  • x_range (tuple(float,float)) – histogram range in X dimension
  • y_range (tuple(float,float)) – histogram range in Y dimension
  • width (float) – bin width, same for both dimensions
  • x_width (float) – bin width in X dimension
  • y_width (float) – bin width in Y dimension

Methods Summary

count()
get_bin_by_coordinates(coords)
get_bin_by_point(point)
get_bin_coordinates(point)
get_histogram()
get_xyv()
histogram_x()
histogram_y()
observe(*points, **kwargs) Adds observation(s) to this histogram
observe_x_y(x, y) Observes a pair of values: x and y
outliers()

Methods Documentation

count()
get_bin_by_coordinates(coords)
get_bin_by_point(point)
get_bin_coordinates(point)
get_histogram()
get_xyv()
histogram_x()
histogram_y()
observe(*points, **kwargs)

Adds observation(s) to this histogram

This method decides what should be observed and then calls observe_x_y() to make the actual observation

Parameters:
  • pointstuple(float,float) or list(tuple(float,float)) - data to be inserted into this histogram
  • kwargs – see below
Returns:

None

Keyword Arguments:
 
  • columns (tuple(int,int)) – which columns of data holds the observations for the histogram
  • i_column (int) – which column of data hold observations for the first dimension
  • j_column (int) – which column of data hold observations for the second dimension
observe_x_y(x, y)

Observes a pair of values: x and y

Parameters:
  • x – value in the first dimension
  • y – value in the second dimension
Returns:

2D index of the bin where teh given data point was inserted (int, int)

outliers()