cf.RaggedIndexedArray.subarrays¶

RaggedIndexedArray.
subarrays
(shapes=1)[source]¶ Return descriptors for every subarray.
Theses descriptors are used during subarray decompression.
New in version (cfdm): 1.10.0.0
 Parameters
 chunks:
1
or sequence, optional Define the subarray shapes.
Must be either
1
, the default, meaning that all noncompressed dimensions in each subarray have the maximum possible size; or a sequence oftuple
. In the latter case chunks must be allowed as an input tosubarray_shapes
.A valid chunks specification may always be found by normalising an output of
subarray_shapes
withdask.array.core.normalize_chunks
as follows:chunks = dask.array.core.normalize_chunks(a.subarray_shapes(...), shape=a.shape, dtype=a.dtype)
.
 chunks:
 Returns
 4
tuple
of iterators Each iterable iterates over a particular descriptor from each subarray.
The indices of the uncompressed array that correspond to each subarray.
The shape of each uncompressed subarray.
The indices of the compressed array that correspond to each subarray.
The location of each subarray on the uncompressed dimensions.
 4
Examples
An original 2d array with shape (3, 5) comprising 3 timeSeries features has been compressed as an indexed ragged array. The features have counts of have counts of 2, 5, and 4 elements, at compressed locations (5, 8), (1, 3, 4, 7, 10), and (0, 2, 6, 9) respectively.
>>> u_indices, u_shapes, c_indices, locations = x.subarrays() >>> for i in u_indices: ... print(i) ... (slice(0, 1, None), slice(0, 5, None)) (slice(1, 2, None), slice(0, 5, None)) (slice(2, 3, None), slice(0, 5, None)) >>> for i in u_shapes ... print(i) ... (1, 12) (1, 12) (1, 12) >>> for i in c_indices: ... print(i) ... (array([5, 8]),) (array([1, 3, 4, 7, 10]),) (array([0, 2, 6, 9]),) >>> for i in locations: ... print(i) ... (0, 0) (1, 0) (2, 0)