tiledbsoma.io.update_matrix¶
- tiledbsoma.io.update_matrix(soma_ndarray: SparseNDArray | DenseNDArray, new_data: ndarray | Dataset | csr_matrix | csc_matrix | CSCDataset | CSRDataset, *, context: SOMATileDBContext | None = None, platform_config: Dict[str, Mapping[str, Any]] | object | None = None) None¶
Given a
SparseNDArrayorDenseNDArrayalready opened for write, writes the new data. It is the caller’s responsibility to ensure that the intended shape of written contents of the array match those of the existing data. The intended use-case is to replace updated numerical values.Example:
with tiledbsoma.Experiment.open(uri, "w") as exp: tiledbsoma.io.update_matrix( exp.ms["RNA"].X["data"], adata.X, )
- Parameters:
soma_ndarray – a
SparseNDArrayorDenseNDArrayalready opened for write.new_data – If the
soma_ndarrayis sparse, a Scipy CSR/CSC matrix or AnnDataCSCDataset/CSRDataset. If thesoma_ndarrayis dense, a NumPy NDArray.context – Optional
SOMATileDBContextcontaining storage parameters, etc.platform_config – Platform-specific options used to update this array, provided in the form
{"tiledb": {"create": {"dataframe_dim_zstd_level": 7}}}
- Returns:
None
Lifecycle
Maturing.