MCPcopy Index your code
hub / github.com/dask/dask / histogram2d

Function histogram2d

dask/array/routines.py:1070–1141  ·  view source on GitHub ↗

Blocked variant of :func:`numpy.histogram2d`. 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 histogr

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

Source from the content-addressed store, hash-verified

1068
1069
1070def histogram2d(x, y, bins=10, range=None, normed=None, weights=None, density=None):
1071 """Blocked variant of :func:`numpy.histogram2d`.
1072
1073 Parameters
1074 ----------
1075 x : dask.array.Array
1076 An array containing the `x`-coordinates of the points to be
1077 histogrammed.
1078 y : dask.array.Array
1079 An array containing the `y`-coordinates of the points to be
1080 histogrammed.
1081 bins : sequence of arrays describing bin edges, int, or sequence of ints
1082 The bin specification. See the `bins` argument description for
1083 :py:func:`histogramdd` for a complete description of all
1084 possible bin configurations (this function is a 2D specific
1085 version of histogramdd).
1086 range : tuple of pairs, optional.
1087 The leftmost and rightmost edges of the bins along each
1088 dimension when integers are passed to `bins`; of the form:
1089 ((xmin, xmax), (ymin, ymax)).
1090 normed : bool, optional
1091 An alias for the density argument that behaves identically. To
1092 avoid confusion with the broken argument in the `histogram`
1093 function, `density` should be preferred.
1094 weights : dask.array.Array, optional
1095 An array of values weighing each sample in the input data. The
1096 chunks of the weights must be identical to the chunking along
1097 the 0th (row) axis of the data sample.
1098 density : bool, optional
1099 If False (the default) return the number of samples in each
1100 bin. If True, the returned array represents the probability
1101 density function at each bin.
1102
1103 Returns
1104 -------
1105 dask.array.Array
1106 The values of the histogram.
1107 dask.array.Array
1108 The edges along the `x`-dimension.
1109 dask.array.Array
1110 The edges along the `y`-dimension.
1111
1112 See Also
1113 --------
1114 histogram
1115 histogramdd
1116
1117 Examples
1118 --------
1119 >>> import dask.array as da
1120 >>> x = da.array([2, 4, 2, 4, 2, 4])
1121 >>> y = da.array([2, 2, 4, 4, 2, 4])
1122 >>> bins = 2
1123 >>> range = ((0, 6), (0, 6))
1124 >>> h, xedges, yedges = da.histogram2d(x, y, bins=bins, range=range)
1125 >>> h
1126 dask.array<sum-aggregate, shape=(2, 2), dtype=float64, chunksize=(2, 2), chunktype=numpy.ndarray>
1127 >>> xedges

Callers

nothing calls this directly

Calls 1

histogramddFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…