bpcells.experimental.DirMatrix.from_scipy_sparse#

classmethod DirMatrix.from_scipy_sparse(scipy_mat: spmatrix, dir: str) DirMatrix[source]#

Create a DirMatrix from a scipy sparse matrix.

Will write in compressed sparse column format for all input types other than scipy.sparse.csr_matrix

Parameters:
  • scipy_mat (scipy.spmatrix) – Scipy sparse matrix

  • dir (str) – Path to write the matrix

Returns:

View of the matrix written to disk

Return type:

DirMatrix