title: Merge pandas df based on 2 keys
body: <p>I have 2 df and I would like to merge them based on 2 keys - ID and date:
  I following is just a small slice of the entire df</p>
  
  <p><strong>df_pw6</strong></p>
  
  <pre><code>     ID     date           pw10_0        pw50_0     pw90_0
  0   153     2018-01-08     27.88590     43.2872     58.2024
  0   2       2018-01-05     11.03610     21.4879     31.6997
  0   506     2018-01-08     6.98468      25.3899     45.9486
  </code></pre>
  
  <p><strong>df_ex</strong></p>
  
  <pre><code>    date         ID   measure f188  f187  f186  f185
  0   2017-07-03  501     NaN     1   0.5     7   4.0
  1   2017-07-03  502     NaN     0   2.5     5   3.0
  2   2018-01-08  506     NaN     5   9.0     9   1.2
  </code></pre>
  
  <p>As you can see, only the third row has a match. 
  When I type:</p>
  
  <pre><code>#check date
  df_ex.iloc[2,0]== df_pw6.iloc[1,1]
  True
  
  #check ID
  df_ex.iloc[2,1] == df_pw6.iloc[2,0]
  True
  </code></pre>
  
  <p>Now I try to merge them:</p>
  
  <pre><code>df19 = pd.merge(df_pw6,df_ex,on=['date','ID'])
  </code></pre>
  
  <p>I get an empty df</p>
  
  <p>When I try:</p>
  
  <pre><code>df19 = pd.merge(df_pw6,df_ex,how ='left',on=['date','ID'])
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>    ID     date                  pw10_0     pw50_0     pw90_0   measure     f188    f187    f186    f185
  0   153 2018-01-08 00:00:00     27.88590    43.2872     58.2024     NaN     NaN     NaN     NaN     NaN
  1   2   2018-01-05 00:00:00     11.03610    21.4879     31.6997     NaN     NaN     NaN     NaN     NaN
  2   506 2018-01-08 00:00:00     6.98468     25.3899     45.9486     NaN     NaN     NaN     NaN     NaN
  </code></pre>
  
  <p>My desired result should be:</p>
  
  <pre><code>&gt;      ID     date                    pw10_0       pw50_0     pw90_0   measure f188  f187  f186  f185
  &gt; 
  &gt; 0   506     2018-01-08 00:00:00     6.98468     25.3899     45.9486   NaN     5     9.0     9   1.2
  </code></pre>