title: How can I create a label encoder utilizing only numpy (and not sklearn LabelEncoder)?
body: <p>I am trying to recreate something similar to the 
  <code>sklearn.preprocessing.LabelEncoder</code></p>
  
  <p>However I do not want to use <code>sklearn</code> or <code>pandas</code>. I would like to only use <code>numpy</code> and the Python standard library. Here's what I would like to achieve:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  input = np.array([['hi', 'there'],
                       ['scott', 'james'],
                       ['hi', 'scott'],
                       ['please', 'there']])
  
  # Output would look like
  np.ndarray([[0, 0],
              [1, 1],
              [0, 2],
              [2, 0]])
  </code></pre>
  
  <p>It would also be great to be able to map it back as well, so a result would then look exactly like the input again.</p>
  
  <p>If this were in a spreadsheet, the input would look like this:
  <a href="https://i.stack.imgur.com/6ag01.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6ag01.png" alt="enter image description here"></a></p>