anndict.ensure_label_consistency_main#
- anndict.ensure_label_consistency_main(df, simplification_level='unified, typo-fixed')[source]#
Function to ensure label consistency across multiple columns in a DataFrame by mapping labels to a unified and simplified set.
- Parameters:
- df
DataFrame a
DataFramecontaining categorical columns across which to unify category labels (so that all columns share the same set of labels).- simplification_level
str(default:'unified, typo-fixed') Qualitative direction about how to process the labels.
- df
- Return type:
tuple[DataFrame,dict]- Returns:
class:DataFrame containing the columns in
df, now with labels shared across all columns class:dict containing the full mapping of original labels to the new, shared set of labels