I encode my data by using defaultdict
,
this is my code:
from collections import defaultdict
d = defaultdict(LabelEncoder)
df_del = df.drop(columns=['DEPTN'])
df_encoded = df_del.apply(lambda x: d[x.name].fit_transform(x))
inverse = df_encoded.apply(lambda x: d[x.name].inverse_transform(x))
How to combine this together to see the mapping of values?