fraction: float
Subsample to this fraction of the number of observations.
import scanpy as sc
# subsample data to 90% of original size (n_obs has no effect here)
sc.pp.subsample(adata, n_obs=None, fraction=0.9, random_state=42)
# subsample data to 1000 observations (fraction has no effect here)
sc.pp.subsample(adata, n_obs=1000, fraction=None, random_state=42)