profile

hep_spt.profile(x, y, bins=20, range=None, weights=None, std_type='mean')[source]

Calculate the profile from a 2D data sample. It corresponds to the mean of the values in “y” for each bin in “x”.

Parameters
  • x (numpy.ndarray(value-type)) – values to consider for the binning.

  • y (numpy.ndarray(value-type)) – values to calculate the mean with.

  • bins (int or sequence of scalars or str) – see numpy.histogram().

  • range (None or tuple(float, float)) – range to process in the input array.

  • weights (None or numpy.ndarray(value-type)) – possible array of weights for the profile.

  • std_type (str) – type of standard deviation to be returned. The default (‘mean’) makes this function return the standard deviation of the mean. If set to ‘sample’, it will return the standard deviation of the sample instead. The definitions can be seen in stat_values().

Returns

profile in “y”, edges and standard deviation.

Return type

numpy.ndarray, numpy.ndarray

Raises

ValueError – If an unknown standard deviation type is provided.