scallops.features.agg.agg_features
- scallops.features.agg.agg_features(data, by, weights_col=None, agg_func='mean')
Aggregate features
- Parameters:
data (AnnData) – Annotated data matrix.
by (str | Sequence[str]) – Perturbation column(s) in data.obs to aggregate by.
weights_col (str | None) – If provided, perform weighted aggregation
agg_func (Literal['mean', 'median']) – Aggregation method.
- Returns:
Aggregated data