title: Pandas isin with multiple columns
body: <p>I want to select all rows in a dataframe which contain values defined in a list.
  I've got two approaches which both do not work as expected/wanted.</p>
  
  <p>My dataframe looks something like this:</p>
  
  <pre><code>Timestamp DEVICE READING VALUE
  1 | DEV1 | READ1 | randomvalue
  2 | DEV1 | READ2 | randomvalue
  3 | DEV2 | READ1 | randomvalue
  4 | DEV2 | READ2 | randomvalue
  5 | DEV3 | READ1 | randomvalue
  </code></pre>
  
  <p>and I've got the list (ls) like follows:</p>
  
  <pre><code>[[DEV1, READ1], [DEV1, READ2], [DEV2,READ1]]
  </code></pre>
  
  <p>In this scenario I want to remove line <code>4</code> and <code>5</code>:</p>
  
  <p>My first approach was:</p>
  
  <pre><code>df = df[(df['DEVICE']. isin([ls[i][0] for i in range(len(ls))])) &amp;
          (df['READING'].isin([ls[k][1] for k in range(len(ls))]))]
  </code></pre>
  
  <p>The problem with this one is obviously, that it does not remove line 4, because DEV2 has the READING READ2, but it should remove it.</p>
  
  <p>My second approach was:</p>
  
  <pre><code>df = df[(df[['DEVICE','READING']].isin({'DEVICE':  [ls[i][0] for i in range(len(ls))],
                                          'READING': [ls[i][1] for i in range(len(ls))] }))]
  </code></pre>
  
  <p>This one selects the correct rows but it does not remove the other rows. Instead it sets every other cell to NaN, including the VALUE ROW, which i do want to keep. And It does not accumulate both so row 4 looks like <code>4 |DEV2|NaN|NaN</code></p>
  
  <p>What would be the easiest or best way, to solve this problem?
  Can you help me?</p>
  
  <p>~Fabian</p>