title: How to generate id number using python?
body: <p>I have a dataframe. I want to create a unique ID number for each person and create a column based the person and date(weekly). </p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({ 'name':['one','one','two','two','two','three','four'],
                       'date':['2019-05-01','2019-05-08','2019-05-01','2019-05-08','2019-05-15','2019-05-01','2019-05-15'],
                      "a":range(7)})
  df['date'] = pd.to_datetime(df['date'],yearfirst=True)
  df = df.sort_values(['name','date'])
  print(df)
  </code></pre>
  
  <p>This is the data:</p>
  
  <pre><code>    name       date  a
  6   four 2019-05-15  6
  0    one 2019-05-01  0
  1    one 2019-05-08  1
  5  three 2019-05-01  5
  2    two 2019-05-01  2
  3    two 2019-05-08  3
  4    two 2019-05-15  4
  </code></pre>
  
  <p>The expected result is </p>
  
  <pre><code>    name       date  a    id    week
  6   four 2019-05-15  6     1    3
  0    one 2019-05-01  0     2    1
  1    one 2019-05-08  1     2    2
  5  three 2019-05-01  5     3    1 
  2    two 2019-05-01  2     4    1
  3    two 2019-05-08  3     4    2
  4    two 2019-05-15  4     4    3
  </code></pre>
  
  <p>How can I get the "id" and "week"?
  Thank you!</p>