pipe_obs#
- SingleCell.pipe_obs(function, /, *args, **kwargs)[source]#
Apply a function to a SingleCell dataset’s obs.
sc = sc.pipe_obs(func) is equivalent to sc.obs = func(sc.obs). sc = sc.pipe_obs(func, 1, a=2) is equivalent to sc.obs = func(sc.obs, 1, a=2).
- Parameters:
function: Callable[[DataFrame, ...], DataFrame]
the function to apply to obs. It must take the old obs as its first argument and return the new obs. The function may also take other arguments after obs, which can be specified via args and kwargs.
*args: Any
the positional arguments to the function
**kwargs: Any
the keyword arguments to the function
- Returns:
A new SingleCell dataset where the function has been applied to obs.
- Return type: