title: Convert categorical variables from String to int representation
body: <p>I have a numpy array of classification of text in the form of String array, i.e. 
  <code>y_train = ['A', 'B', 'A', 'C',...]</code>. I am trying to apply SKlearn multinomial NB algorithm to predict classes for entire dataset. </p>
  
  <p>I want to convert the String classes into integers to be able to input into the algorithm and convert <code>['A', 'B', 'A', 'C', ...]</code> into <code>['1', '2', '1', '3', ...]</code></p>
  
  <p>I can write a for loop to go through array and create a new one with int classifiers but is there a direct function to achieve this</p>