anndata.abc.CSRDataset.__getitem__

anndata.abc.CSRDataset.__getitem__#

abstract CSRDataset.__getitem__(index)[source]#

Load a slice or an element from the sparse dataset into memory.

Parameters:
index slice | int | str | int64 | ndarray | EllipsisType | tuple[slice | int | str | int64 | ndarray, slice | int | str | int64 | ndarray | EllipsisType] | tuple[slice | int | str | int64 | ndarray | EllipsisType, slice | int | str | int64 | ndarray] | tuple[slice | int | str | int64 | ndarray, slice | int | str | int64 | ndarray, EllipsisType] | tuple[EllipsisType, slice | int | str | int64 | ndarray, slice | int | str | int64 | ndarray] | tuple[slice | int | str | int64 | ndarray, EllipsisType, slice | int | str | int64 | ndarray] | spmatrix | sparray

Index to load.

Return type:

float | csr_matrix | csc_matrix | sparray

Returns:

The desired data read off disk.