title: How to generate the unique id from a list of ids containing duplicates
body: <p>I am using pandas package to deal with my data, and I have a dataframe looks like below. </p>
  
  <pre><code>data = pd.read_csv('people.csv')
  id, A, B
  John, 1, 3
  Mary, 2, 5
  John, 4, 6
  John, 3, 7
  Mary, 5, 2
  </code></pre>
  
  <p>I'd like to produce the unique id for those duplicates but keep the same order of them. </p>
  
  <pre><code>id, A, B
  John, 1, 3
  Mary, 2, 5
  John.1, 4, 6
  John.2, 3, 7   # John shows up three times.
  Mary.1, 5, 2   # Mary shows up twice.
  </code></pre>
  
  <p>I tried something like <code>set_index</code>, <code>pd.factorize()</code> and <code>index_col</code> but they do not work. </p>