blosc2.Proxy.__getitem__#
- Proxy.__getitem__(item: slice | list[slice]) ndarray #
Get a slice as a numpy.ndarray using the Proxy.
- Parameters:
item¶ (slice or list of slices) – The slice of the desired data.
- Returns:
out – An array with the data slice.
- Return type:
numpy.ndarray
Examples
>>> import numpy as np >>> import blosc2 >>> data = np.arange(25).reshape(5, 5) >>> ndarray = blosc2.asarray(data) >>> proxy = blosc2.Proxy(ndarray) >>> proxy[0:3, 0:3] [[ 0 1 2] [ 5 6 7] [10 11 12] [20 21 22]] >>> proxy[2:5, 2:5] [[12 13 14] [17 18 19] [22 23 24]]