def value_assignment(df):
unique_values = np.unique(df[['X0', 'X1', 'X2','X3','X4','X5','X6','X8']].values)
dict_vals = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,
'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25,'aa':26,'ab':27,
'ac':28,'ad':29,'ae':30,'af':31,'ag':32,'ah':33,'ai':34,'aj':35,'ak':36,'al':37,'am':38,'an':39,
'ao':40,'ap':41,'aq':42,'ar':43,'as':44,'at':45,'au':46,'av':47,'aw':'48','ax':49,'ay':50,'az':51,
'ba':52,'bb':53,'bc':54}
cols = ['X0', 'X1', 'X2','X3','X4','X5','X6','X8']
for col in cols:
df[col] = df[col].astype('object')
df[col].replace(dict_vals, inplace=True)
#df[col] = df[col].astype('int64')
df[cols] = df[cols].apply(pd.to_numeric, errors='coerce')
return df
""" calling value_assignment function to assign numerical values to categorical attributes """
train_df_prep = value_assignment(ret_train_df)
test_df_prep = value_assignment(ret_test_df)