Transform string annotations to categoricals.
Only affects string annotations that lead to less categories than the
total number of observations.
- Parameters:
- df
DataFrame
| None
(default: None
) If df
is None
, modifies both obs
and var
,
otherwise modifies df
inplace.
Notes
Turns the view of an AnnData
into an actual
AnnData
.