title: Mapping values in a pandas dataframe column to a sequence of numbers
body: <p>I have a dataframe like this (please discard the first column):</p>
  
  <pre><code>    user_id created_at  count
  1   12136   2017-02-19  4
  2   12136   2017-02-16  4
  3   12136   2017-02-17  2
  4   72349   2017-02-17  8
  5   72349   2017-02-19  2
  7   72672   2017-02-20  3
  8   72672   2017-02-19  2
  </code></pre>
  
  <p>So, I want to map this values to integer values starting from 0:</p>
  
  <pre><code>12136 -&gt; 0
  72349 -&gt; 1 
  72672 -&gt; 2
  </code></pre>
  
  <p>And similarly, for the created_at column (starting from the smallest value)</p>
  
  <pre><code>2017-02-16 -&gt; 0
  2017-02-17 -&gt; 1
  2017-02-19 -&gt; 2
  2017-02-20 -&gt; 3
  </code></pre>
  
  <p>At the end I should have this dataframe (note that 0 values are added for dates where there is no user activity):</p>
  
  <pre><code>user_id created_at  count
  0       0           4
  0       1           2
  0       2           4
  0       3           0
  1       0           0
  1       1           8
  1       2           2
  1       3           0
  2       0           0
  2       1           0
  2       2           2
  2       3           3
  </code></pre>
  
  <p>Also I need to obtain these lists:</p>
  
  <pre><code>label1 = [12136, 72349, 72672]
  label2 = ['2017-02-16', '2017-02-17', '2017-02-19', '2017-02-20']
  </code></pre>
  
  <p>I wonder if there are any methods that could assist me in performing this efficiently?</p>