Change values from nominal to numeric
It's called Label Encoding

In python with the help of scikit-learn you can do following:


  le = preprocessing.LabelEncoder() le.fit(["paris", "paris", "tokyo",
  "amsterdam"])
  
  list(le.classes_)
  
  le.transform(["tokyo", "tokyo", "paris"]) 
  
  list(le.inverse_transform([2, 2, 1]))


Documentation for more info: https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.LabelEncoder.html

PS: Label Encoding might be responsible for unintentional ordering of possible values. I.E. model might think that nominal value with associated numerical value 2 is more important than the nominal value with associated numerical value 1. The solution is One Hot Encoding.