muon.pp.sample_obs(data: Union[anndata._core.anndata.AnnData, mudata._core.mudata.MuData], frac: float = 0.1, groupby: Optional[str] = None, min_n: Optional[int] = None)#

Return an object with some of the observations (subsampling).

  • data (AnnData or MuData) – AnnData or MuData object.

  • frac (float (0.1 by default)) – A fraction of observations to return.

  • groupby (str) – Categorical column in .obs that is used for prior grouping before sampling observations.

  • min_n (int) – Return min_n observations if fraction frac of observations is below min_n. When groupby is not None, min_n is applied per group.

  • data. (Returns a view of the) –