pipe_obsp#
- SingleCell.pipe_obsp(function, /, *args, **kwargs)[source]#
Apply a function to a SingleCell dataset’s obsp.
sc = sc.pipe_obsp(func) is equivalent to sc.obsp = func(sc.obsp). sc = sc.pipe_obsp(func, 1, a=2) is equivalent to sc.obsp = func(sc.obsp, 1, a=2).
- Parameters:
function: Callable[[dict[str, csr_array | csc_array], ...], dict[str, csr_array | csc_array]]
the function to apply to obsp. It must take the old obsp as its first argument and return the new obsp. The function may also take other arguments after obsp, which can be specified via args and kwargs.
*args: Any
the positional arguments to the function
**kwargs: Any
the keyword arguments to the function
- Return type:
To apply a function to a specific key of obsp, rather than to obsp as a whole, use pipe_obsp_key().
- Returns:
A new SingleCell dataset where the function has been applied to obsp.
- Parameters:
function: Callable[[dict[str, csr_array | csc_array], ...], dict[str, csr_array | csc_array]]
args: Any
kwargs: Any
- Return type: