pyinterp.Binning1D

class pyinterp.Binning1D(x: Axis, range: tuple[float, float] | None = None, dtype: dtype | None = None)[source]

Bases: object

Group a number of more or less continuous values into a smaller number of “bins” located on a vector.

Parameters:
  • x – Definition of the bin centers for the X axis of the grid.

  • range – The lower and upper range of the bins. If not provided, range is simply (x.min_value(), x.max_value()).

  • dtype – Data type of the instance to create.

Note

The axe define the centers of the different bins where the statistics will be calculated.

Attributes

x

Gets the bin centers for the X Axis of the grid.

Public Methods

clear()

Clears the data inside each bin.

push(x, z[, weights])

Push new samples into the defined bins.

push_delayed(x, z[, weights])

Push new samples into the defined bins from dask array.

range()

Gets the lower and upper range of the bins.

variable([statistics])

Gets the regular grid containing the calculated statistics.

Special Methods

__add__(other)

Overrides the default behavior of the + operator.

__repr__()

Called by the repr() built-in function to compute the string representation of this instance.