with_obsp#

SingleCell.with_obsp(obsp=None, /, **more_obsp)[source]#

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

Parameters:
  • obsp: dict[str, csr_array | csc_array | csr_matrix | csc_matrix] | None

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

  • **more_obsp: csr_array | csc_array | csr_matrix | csc_matrix

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

Returns:

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

Return type:

SingleCell