I have a dataset consisting of 382 rows and 4 columns. I need to convert all the names in to numbers. The names do repeat here and there, so I can't just randomly give numbers. So, I made a dictionary of the names and the corresponding values. But now, I am not able to change the values in the column. This is how I tried to add the values to the column:
test_df.replace(to_replace = d_loc,value = None, regex = True, inplace = True)
print(test_df)
but test_df just gives me the same dataframe, without any modifications. What should I use? I have over 100 unique names, so I cannot mannually rename them.