anndata.io.write_elem

Contents

anndata.io.write_elem#

anndata.io.write_elem(store, k, elem, *, dataset_kwargs=mappingproxy({}))[source]#

Write an element to a storage group using anndata encoding.

Parameters:
store Group | Group

The group to write to.

k str

The key to write to in the group. Note that absolute paths will be written from the root.

elem DataFrame | number | str | ndarray | MaskedArray | csr_matrix | csc_matrix | sparray | Array | Dataset | Array | ZappyArray | CSRDataset | CSCDataset | DaskArray | CupyArray | CupySparseMatrix | dict[str, AxisStorable] | list[AxisStorable] | AnnData | Categorical | ExtensionArray

The element to write. Typically an in-memory object, e.g. an AnnData, pandas dataframe, scipy sparse matrix, etc.

dataset_kwargs Mapping[str, Any] (default: mappingproxy({}))

Keyword arguments to pass to the stores dataset creation function. E.g. for zarr this would be chunks, compressor.

Return type:

None