title: Filter a pandas dataframe using values from a dict
body: <p>I need to filter a data frame with a dict, constructed with the key being the column name and the value being the value that I want to filter:</p>
  
  <pre><code>filter_v = {'A':1, 'B':0, 'C':'This is right'}
  # this would be the normal approach
  df[(df['A'] == 1) &amp; (df['B'] ==0)&amp; (df['C'] == 'This is right')]
  </code></pre>
  
  <p>But I want to do something on the lines</p>
  
  <pre><code>for column, value in filter_v.items():
      df[df[column] == value]
  </code></pre>
  
  <p>but this will filter the data frame several times, one value at a time, and not apply all filters at the same time. Is there a way to do it programmatically?</p>
  
  <p>EDIT: an example:</p>
  
  <pre><code>df1 = pd.DataFrame({'A':[1,0,1,1, np.nan], 'B':[1,1,1,0,1], 'C':['right','right','wrong','right', 'right'],'D':[1,2,2,3,4]})
  filter_v = {'A':1, 'B':0, 'C':'right'}
  df1.loc[df1[filter_v.keys()].isin(filter_v.values()).all(axis=1), :]
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>    A   B   C   D
  0   1   1   right   1
  1   0   1   right   2
  3   1   0   right   3
  </code></pre>
  
  <p>but the expected result was</p>
  
  <pre><code>    A   B   C   D
  3   1   0   right   3
  </code></pre>
  
  <p>only the last one should be selected.</p>