dask 2021.10.0

ParametersReturnsBackRef
histogram2d(x, y, bins=10, range=None, normed=None, weights=None, density=None)

Parameters

x : dask.array.Array

An array containing the x-coordinates of the points to be histogrammed.

y : dask.array.Array

An array containing the y-coordinates of the points to be histogrammed.

bins : sequence of arrays describing bin edges, int, or sequence of ints

The bin specification. See the :None:None:`bins` argument description for histogramdd for a complete description of all possible bin configurations (this function is a 2D specific version of histogramdd).

range : tuple of pairs, optional.

The leftmost and rightmost edges of the bins along each dimension when integers are passed to :None:None:`bins`; of the form: ((xmin, xmax), (ymin, ymax)).

normed : bool, optional

An alias for the density argument that behaves identically. To avoid confusion with the broken argument in the histogram function, :None:None:`density` should be preferred.

weights : dask.array.Array, optional

An array of values weighing each sample in the input data. The chunks of the weights must be identical to the chunking along the 0th (row) axis of the data sample.

density : bool, optional

If False (the default) return the number of samples in each bin. If True, the returned array represents the probability density function at each bin.

Returns

dask.array.Array

The values of the histogram.

dask.array.Array

The edges along the x-dimension.

dask.array.Array

The edges along the y-dimension.

Blocked variant of numpy.histogram2d .

See Also

histogram
histogramdd

Examples

This example is valid syntax, but we were not able to check execution
>>> import dask.array as da
... x = da.array([2, 4, 2, 4, 2, 4])
... y = da.array([2, 2, 4, 4, 2, 4])
... bins = 2
... range = ((0, 6), (0, 6))
... h, xedges, yedges = da.histogram2d(x, y, bins=bins, range=range)
... h dask.array<sum-aggregate, shape=(2, 2), dtype=float64, chunksize=(2, 2), chunktype=numpy.ndarray>
This example is valid syntax, but we were not able to check execution
>>> xedges
dask.array<array, shape=(3,), dtype=float64, chunksize=(3,), chunktype=numpy.ndarray>
This example is valid syntax, but we were not able to check execution
>>> h.compute()
array([[2., 1.],
       [1., 2.]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.array.routines.histogram2d

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/routines.py#1016
type: <class 'function'>
Commit: