artemis.externals.physt

P(i/y)thon h(i/y)stograms. Inspired (and based on) numpy.histogram, but designed for humans(TM) on steroids(TM).

(C) Jan Pipek, 2016-9, MIT licence See https://github.com/janpipek/physt

Modified by Ryan Mackenzie White for the Artemis Framework

Package Contents

artemis.externals.physt.__version__ = 0.4.6
artemis.externals.physt.histogram(data, bins=None, *args, **kwargs)

Facade function to create 1D histograms.

This proceeds in three steps: 1) Based on magical parameter bins, construct bins for the histogram 2) Calculate frequencies for the bins 3) Construct the histogram object itself

Guiding principle: parameters understood by numpy.histogram should be understood also by physt.histogram as well and should result in a Histogram1D object with (h.numpy_bins, h.frequencies) same as the numpy.histogram output. Additional functionality is a bonus.

This function is also aliased as “h1”.

Parameters
  • data (array_like, optional) – Container of all the values (tuple, list, np.ndarray, pd.Series)

  • bins (int or sequence of scalars or callable or str, optional) – If iterable => the bins themselves If int => number of bins for default binning If callable => use binning method (+ args, kwargs) If string => use named binning method (+ args, kwargs)

  • weights (array_like, optional) – (as numpy.histogram)

  • keep_missed (Optional[bool]) – store statistics about how many values were lower than limits and how many higher than limits (default: True)

  • dropna (bool) – whether to clear data from nan’s before histogramming

  • name (str) – name of the histogram

  • axis_name (str) – name of the variable on x axis

  • adaptive (bool) – whether we want the bins to be modifiable (useful for continuous filling of a priori unknown data)

  • dtype (type) – customize underlying data type: default int64 (without weight) or float (with weights)

  • numpy.histogram parameters are excluded, (Other) –

  • the methods of the Histogram1D class itself. (see) –

Returns

Return type

physt.histogram1d.Histogram1D

See also

numpy.histogram()

artemis.externals.physt.h1
artemis.externals.physt.collection(data, bins=10, *args, **kwargs)

Create histogram collection with shared binnning.