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 anndata.typing.Index

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.