def _categorize_block(df, categories):
    df = df.copy()
    for col, vals in categories.items():
        df[col] = pd.Categorical(df[col], categories=vals, ordered=False)
    return df
Categorize a dataframe with given categories
dataset/ETHPy150Open dask/dask/dask/dataframe/categorical.py/_categorize_block