caterva2.File.__getitem__#

File.__getitem__(slice_)#

Get a slice of the dataset.

Parameters:

slice_ (int, slice, tuple of ints and slices, or None) – The slice to fetch.

Returns:

The slice.

Return type:

numpy.ndarray

Examples

>>> root = cat2.Root('foo')
>>> ds = root['ds-1d.b2nd']
>>> ds[1]
array(1)
>>> ds[:1]
array([0])
>>> ds[0:10]
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])