Blocked variant of :func:`numpy.histogramdd`. Chunking of the input data (``sample``) is only allowed along the 0th (row) axis (the axis corresponding to the total number of samples). Data chunked along the 1st axis (column) axis is not compatible with this function. If weights are
(sample, bins, range=None, normed=None, weights=None, density=None)
| 1180 | |
| 1181 | |
| 1182 | def histogramdd(sample, bins, range=None, normed=None, weights=None, density=None): |
| 1183 | """Blocked variant of :func:`numpy.histogramdd`. |
| 1184 | |
| 1185 | Chunking of the input data (``sample``) is only allowed along the |
| 1186 | 0th (row) axis (the axis corresponding to the total number of |
| 1187 | samples). Data chunked along the 1st axis (column) axis is not |
| 1188 | compatible with this function. If weights are used, they must be |
| 1189 | chunked along the 0th axis identically to the input sample. |
| 1190 | |
| 1191 | An example setup for a three dimensional histogram, where the |
| 1192 | sample shape is ``(8, 3)`` and weights are shape ``(8,)``, sample |
| 1193 | chunks would be ``((4, 4), (3,))`` and the weights chunks would be |
| 1194 | ``((4, 4),)`` a table of the structure: |
| 1195 | |
| 1196 | +-------+-----------------------+-----------+ |
| 1197 | | | sample (8 x 3) | weights | |
| 1198 | +=======+=====+=====+=====+=====+=====+=====+ |
| 1199 | | chunk | row | `x` | `y` | `z` | row | `w` | |
| 1200 | +-------+-----+-----+-----+-----+-----+-----+ |
| 1201 | | | 0 | 5 | 6 | 6 | 0 | 0.5 | |
| 1202 | | +-----+-----+-----+-----+-----+-----+ |
| 1203 | | | 1 | 8 | 9 | 2 | 1 | 0.8 | |
| 1204 | | 0 +-----+-----+-----+-----+-----+-----+ |
| 1205 | | | 2 | 3 | 3 | 1 | 2 | 0.3 | |
| 1206 | | +-----+-----+-----+-----+-----+-----+ |
| 1207 | | | 3 | 2 | 5 | 6 | 3 | 0.7 | |
| 1208 | +-------+-----+-----+-----+-----+-----+-----+ |
| 1209 | | | 4 | 3 | 1 | 1 | 4 | 0.3 | |
| 1210 | | +-----+-----+-----+-----+-----+-----+ |
| 1211 | | | 5 | 3 | 2 | 9 | 5 | 1.3 | |
| 1212 | | 1 +-----+-----+-----+-----+-----+-----+ |
| 1213 | | | 6 | 8 | 1 | 5 | 6 | 0.8 | |
| 1214 | | +-----+-----+-----+-----+-----+-----+ |
| 1215 | | | 7 | 3 | 5 | 3 | 7 | 0.7 | |
| 1216 | +-------+-----+-----+-----+-----+-----+-----+ |
| 1217 | |
| 1218 | If the sample 0th dimension and weight 0th (row) dimension are |
| 1219 | chunked differently, a ``ValueError`` will be raised. If |
| 1220 | coordinate groupings ((x, y, z) trios) are separated by a chunk |
| 1221 | boundary, then a ``ValueError`` will be raised. We suggest that you |
| 1222 | rechunk your data if it is of that form. |
| 1223 | |
| 1224 | The chunks property of the data (and optional weights) are used to |
| 1225 | check for compatibility with the blocked algorithm (as described |
| 1226 | above); therefore, you must call `to_dask_array` on a collection |
| 1227 | from ``dask.dataframe``, i.e. :class:`dask.dataframe.Series` or |
| 1228 | :class:`dask.dataframe.DataFrame`. |
| 1229 | |
| 1230 | The function is also compatible with `x`, `y`, and `z` being |
| 1231 | individual 1D arrays with equal chunking. In that case, the data |
| 1232 | should be passed as a tuple: ``histogramdd((x, y, z), ...)`` |
| 1233 | |
| 1234 | Parameters |
| 1235 | ---------- |
| 1236 | sample : dask.array.Array (N, D) or sequence of dask.array.Array |
| 1237 | Multidimensional data to be histogrammed. |
| 1238 | |
| 1239 | Note the unusual interpretation of a sample when it is a |
no test coverage detected
searching dependent graphs…