title: Unique UUID base on n columns of Pandas dataframe (to handle duplicates on ElasticSearch)
body: <p>i am creating a function to set an UUID column base on the values of other columns. What i want is to handle duplicates when indexind dataframes into Elasticsearch. The UUID should be always the same based on the value of several columns. </p>
  
  <p>I am having problems with the output, the same UUID is generated for each row.</p>
  
  <p><strong>Dataframe</strong></p>
  
  <pre><code>cols = ['col1', 'col2']
  data = {'col1': ['Mike','Robert','Sandy'],
          'col2': ['100','200','300']}
  
  
          col1 col2  
      0    Mike  100 
      1  Robert  200 
      2   Sandy  300
  </code></pre>
  
  <p><strong>Function</strong></p>
  
  <pre><code>def create_uuid_on_n_col (df):
      # concat column string values 
      concat_col_str_id = df.apply(lambda x: uuid.uuid5(uuid.NAMESPACE_DNS,'_'.join(map(str, x))), axis=1)
      return concat_col_str_id[0]
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>df['id'] = create_uuid_2_col(df[['col1','col2']])
  
       col1 col2                                    id
  0    Mike  100  a17ad043-486f-5eeb-8138-8fa2b10659fd
  1  Robert  200  a17ad043-486f-5eeb-8138-8fa2b10659fd
  2   Sandy  300  a17ad043-486f-5eeb-8138-8fa2b10659fd
  </code></pre>