anndata.abc.CSCDataset#

class anndata.abc.CSCDataset[source]#

Bases: ABC

On disk CSC sparse matrix.

Analogous to h5py.Dataset or zarr.Array, but for sparse matrices.

Attributes

format = 'csc'[source]#

The format of the sparse matrix.

shape[source]#

Shape of the matrix.

dtype[source]#

The numpy.dtype of the data attribute of the sparse matrix.

backend[source]#

Which file type is used on-disk.

Methods

abstractmethod __getitem__(index)[source]#

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

Parameters:
index int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array | EllipsisType | tuple[int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array, int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array | EllipsisType] | tuple[int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array | EllipsisType, int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array] | tuple[int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array, int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array, EllipsisType] | tuple[EllipsisType, int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array, int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array] | tuple[int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array, EllipsisType, int | str | int64 | slice | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[integer]] | Sequence[int] | Sequence[str] | Sequence[bool] | Series | Index | ExtensionArray | ndarray[tuple[Any, ...], dtype[str_]] | matrix | csr_matrix | csc_matrix | csr_array | csc_array]

Index to load.

Return type:

float | csr_matrix | csc_matrix | csr_array | csc_array

Returns:

The desired data read off disk.

abstractmethod to_memory()[source]#

Load the sparse dataset into memory.

Return type:

csr_matrix | csc_matrix | csr_array | csc_array

Returns:

The in-memory representation of the sparse dataset.