title: Generate a sequence by appending values without clash in other values
body: <p>I have a dataframe like as shown below</p>
  <pre><code>df = pd.DataFrame({'person_id': [101,101,101,101,202,202,202],
                          'login_date':['5/7/2013 09:27:00 AM','09/08/2013 11:21:00 AM','06/06/2014 08:00:00 AM','06/06/2014 05:00:00 AM','12/11/2011 10:00:00 AM','13/10/2012 12:00:00 AM','13/12/2012 11:45:00 AM']})
  df.login_date = pd.to_datetime(df.login_date)
  df['logout_date'] = df.login_date + pd.Timedelta(days=5)
  df['login_id'] = [1,1,1,1,11,11,11]
  </code></pre>
  <p>If you look at <code>person_id = 101</code> in the above dataframe, he/she has logged in and out at 4 different timestamps but have the same login_ids which is incorrect.</p>
  <p>Instead, I would like to generate a new login_id for each unique login session where each person gets a new login_id but retains the 1st login_id information in their subsequent logins. So, we can know its a sequence</p>
  <p>I tried the below (based on this <a href="https://stackoverflow.com/questions/67042817/append-sequence-number-with-padded-zeroes-to-a-series-using-padas">post</a>)</p>
  <pre><code>cumcount = df.groupby(['person_id','login_id']).login_id.cumcount()
  df.login_id = df.login_id.mul(100000).add(cumcount)
  </code></pre>
  <p>While the above does work fine for a given sample dataset, but it may fail when there is an actual matching login_id <code>1100001</code>, <code>1100002</code>, <code>1100003</code>. So, if I append <code>00001</code>, <code>00002</code> to my <code>login_id = 11</code>, it may clash with original ids <code>(1100001</code>, <code>1100002</code>, <code>1100003)</code></p>
  <p>We don't necessarily have to append only zeroes to indicate sequence. Any number that doesn't clash with other ids is fine (and it doesn't have to be in order like one after the other). We just need to get some id which doesn't clash with other ids</p>
  <p>How can I generate a random number to indicate login_id without clashing with other login_ids from other users? how can I decide on the numbers to append?</p>
  <p>Please note I would like to apply this on a big data and the login_ids may not just be single digit in real data. For ex, 1st login_id could even be 576869578 etc kind of random number.</p>