jax.numpy.histogram_bin_edges#
- jax.numpy.histogram_bin_edges(a, bins=10, range=None, weights=None)[source]#
Compute the bin edges for a histogram.
JAX implementation of
numpy.histogram_bin_edges()
.- Parameters:
a (ArrayLike) – array of values to be binned
bins (ArrayLike) – Specify the number of bins in the histogram (default: 10).
range (None | Array | Sequence[ArrayLike] | None) – tuple of scalars. Specifies the range of the data. If not specified, the range is inferred from the data.
weights (ArrayLike | None | None) – unused by JAX.
- Returns:
An array of bin edges for the histogram.
- Return type:
See also
jax.numpy.histogram()
: compute a 1D histogram.jax.numpy.histogram2d()
: compute a 2D histogram.jax.numpy.histogramdd()
: compute an N-dimensional histogram.
Examples
>>> a = jnp.array([2, 5, 3, 6, 4, 1]) >>> jnp.histogram_bin_edges(a, bins=5) Array([1., 2., 3., 4., 5., 6.], dtype=float32) >>> jnp.histogram_bin_edges(a, bins=5, range=(-10, 10)) Array([-10., -6., -2., 2., 6., 10.], dtype=float32)