title: Get mapping of categorical variables in pandas
body: <p>I'm doing this to make categorical variables numbers</p>
  
  <pre><code>&gt;&gt;&gt; df = pd.DataFrame({'x':['good', 'bad', 'good', 'great']}, dtype='category')
  
         x
  0   good
  1    bad
  2   good
  3  great
  </code></pre>
  
  <p>How can I get the mapping between the original values and the new values?</p>