tocsc#

SingleCell.tocsc(*, num_threads=None)[source]#

Make a copy of this SingleCell dataset, converting X to a csc_array. Raise an error if X is already a csc_array.

This function is provided for completeness, but csr_array is a far better format than csc_array for cell-wise operations like pseudobulking, so using tocsc() is rarely advisable.

Parameters:

num_threads: int | None

the number of threads to use when converting to CSC. Set num_threads=-1 to use all available cores, as determined by os.cpu_count(). By default (num_threads=None), use self.num_threads cores. Does not affect the returned SingleCell dataset’s num_threads; this will always be the same as the original dataset’s num_threads.

Returns:

A copy of this SingleCell dataset, with X as a csc_array.

Return type:

SingleCell