earthkit.meteo.stats.array.iter_quantiles

earthkit.meteo.stats.array.iter_quantiles(arr, which=100, dim=0, method='sort')

Iterate over the quantiles of a large array.

Parameters:
  • arr (numpy array) – Data array

  • which (int or list of floats) – List of quantiles to compute, e.g. [0., 0.25, 0.5, 0.75, 1.], or number of evenly-spaced intervals (e.g. 100 for percentiles).

  • dim (int) – Dimension index along which to compute the quantiles.

  • method ('sort', 'numpy_bulk', 'numpy') – Method of computing the quantiles: * sort: sort arr in place, then interpolates the quantiles one by one * numpy_bulk: compute all the quantiles at once using numpy.quantile * numpy: compute the quantiles one by one using numpy.quantile

Returns:

Quantiles, in increasing order if which is an int, otherwise in the order specified

Return type:

Iterable[numpy array]