MCPcopy Create free account
hub / github.com/dask/dask / histogram2d

Function histogram2d

dask/array/routines.py:1072–1143  ·  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

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

Callers

nothing calls this directly

Calls 1

histogramddFunction · 0.85

Tested by

no test coverage detected