title: Pandas: InvalidIndexError: Reindexing only valid with uniquely valued Index objects
body: <p>I have two Dataframes that store data about products procured in a store. <code>df1</code> stores data about the store name, product id, product name and the date when the purchase was made. <code>df2</code> stores data about product id, product name and the type. I am trying to update <code>df2</code> with the Date recevied value in <code>df1</code> but only for products of type <code>P</code>.</p>
  
  <p>Given below are views of the dataframe and what I tried doing.</p>
  
  <p><code>df1</code>:</p>
  
  <pre><code>StoreName,ProdId,ProdName,DateReceived
  Store A,P1,Prod1,2018-05-01
  Store A,P2,Prod2,2018-05-02
  Store B,P1,Prod1,2018-05-04
  </code></pre>
  
  <p><code>df2</code>:</p>
  
  <pre><code>DateRecived,ProdId,ProdName,Type
  
  ,P1,Prod1,P
  ,P2,Prod2,P
  ,P3,Prod3,S
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>df2['DateRecived'] = df2['ProdId'].map(df1.set_index('ProdId')['StoreName']).df2['Type'] == 'P'
  </code></pre>
  
  <p>Running this throws the below error:</p>
  
  <pre><code>InvalidIndexError: Reindexing only valid with uniquely valued Index objects
  </code></pre>
  
  <p>Could anyone help me modify the script so that I am able to filter out value by <code>Store Name</code> and <code>Prod Name</code> and get <code>df2</code> populated with the <code>DateReceived</code> value. Thanks.</p>