tobac.analysis.cell_analysis.histogram_cellwise#
- tobac.analysis.cell_analysis.histogram_cellwise(Track, variable=None, bin_edges=None, quantity='max', density=False)#
Create a histogram of the maximum, minimum or mean of a variable for the cells (series of features linked together over multiple timesteps) of a track. Essentially a wrapper of the numpy.histogram() method.
- Parameters:
Track (pandas.DataFrame) – The track containing the variable to create the histogram from.
variable (string, optional) – Column of the DataFrame with the variable on which the histogram is to be based on. Default is None.
bin_edges (int or ndarray, optional) – If bin_edges is an int, it defines the number of equal-width bins in the given range. If bins is a ndarray, it defines a monotonically increasing array of bin edges, including the rightmost edge.
quantity ({'max', 'min', 'mean'}, optional) – Flag determining wether to use maximum, minimum or mean of a variable from all timeframes the cell covers. Default is ‘max’.
density (bool, optional) – If False, the result will contain the number of samples in each bin. If True, the result is the value of the probability density function at the bin, normalized such that the integral over the range is 1. Default is False.
- Returns:
hist (ndarray) – The values of the histogram
bin_edges (ndarray) – The edges of the histogram
bin_centers (ndarray) – The centers of the histogram intervalls
- Raises:
ValueError – If quantity is not ‘max’, ‘min’ or ‘mean’.