compute_statistic

compute_statistic#

glue.utils.array.compute_statistic(statistic, data, mask=None, axis=None, finite=True, positive=False, percentile=None)[source]#

Compute a statistic for the data.

Parameters:
statistic{‘minimum’, ‘maximum’, ‘mean’, ‘median’, ‘sum’, ‘percentile’}

The statistic to compute

data~numpy.ndarray

The data to compute the statistic for.

mask~numpy.ndarray

The mask to apply when computing the statistic.

axisNone or int or tuple of int

If specified, the axis/axes to compute the statistic over.

finitebool, optional

Whether to include only finite values in the statistic. This should be True to ignore NaN/Inf values

positivebool, optional

Whether to include only (strictly) positive values in the statistic. This is used for example when computing statistics of data shown in log space.

percentilefloat, optional

If statistic is 'percentile', the percentile argument should be given and specify the percentile to calculate in the range [0:100]