Create the dictionary for categorical columns levels. For example, Y7:A,B,C,....

dict_level(df, col_cat)

Arguments

df

Dataframe.

col_cat

categorical column index

Value

A dictionary that connects categorical columns with their original levels.