openpathsampling.numerics.Histogram
- class openpathsampling.numerics.Histogram(n_bins=None, bin_width=None, bin_range=None)[source]
Wrapper for numpy.histogram with additional conveniences.
In addition to the behavior in numpy.histogram, this provides a few additional calculations, as well as behavior that allows for better interactive use (tricks to assist caching by libraries using it, etc.)
- __init__(n_bins=None, bin_width=None, bin_range=None)[source]
Creates the parameters for the histogram.
Either n_bins or bin_width must be given. If bin_width is used, then bin_range is required. If n_bins is used, then bin_range is optional. n_bins overrides bin_width.
If no options are given, the default is to use 20 bins and the range generated by np.histogram.
Methods
__init__
([n_bins, bin_width, bin_range])Creates the parameters for the histogram.
add_data_to_histogram
(data[, weights])Adds data to the internal histogram counter.
compare_parameters
(other)Return true if other has the same bin parameters as self.
cumulative
([maximum, bin_edge])Cumulative from the left: number of values less than bin value.
empty_copy
()Returns a new histogram with the same bin shape, but empty
histogram
([data, weights])Build the histogram based on data.
map_to_bins
(data)map_to_float_bins
(trajectory)normalized
([raw_probability, bin_edge])Return normalized version of histogram.
plot_bins
([scaling])Bins used in plotting.
rebinned
(scaling)Redistributes histogram bins of width binwidth*scaling
reverse_cumulative
([maximum, bin_edge])Cumulative from the right: number of values greater than bin value.
sum_histograms
(hists)xvals
([bin_edge_type])Position values for the bin