Reputation: 577
I am working on dataset which has a column which is nominal i.e categorical in nature, somewhat like this:
>>>data['MODE'].unique()
array(['A', 'B', 'C'], dtype=object)
I would like to convert these nominal values to numerical counterparts(A-0,B-1,C-2). How do I do this ?
The code given is just to demonstrate the classes present in the column, I need to convert the entire column to ordinal (that is map A->0,B->1,C->2)
Upvotes: 0
Views: 175