with_obsm#

SingleCell.with_obsm(obsm=None, /, **more_obsm)[source]#

Adds one or more keys to obsm, overwriting existing keys with the same names if present.

Parameters:
  • obsm: dict[str, ndarray | DataFrame] | None

    an optional dictionary of keys to add to (or overwrite in) obsm

  • **more_obsm: ndarray

    additional keys to add to (or overwrite in) obsm, specified as keyword arguments

Returns:

A new SingleCell dataset with the new key(s) added to or overwritten in obsm.

Return type:

SingleCell