title: Slicing a Pandas dataframe with a multiindex by combinations of level values
body: <p>I 'm looking to slice a Pandas dataframe with a multi index by a list of values for some of the index levels.</p>
  <pre><code>import pandas as pd
  index = pd.MultiIndex.from_product((('A','B'),
                                      range(2),
                                      ('c','d')))
  df = pd.DataFrame(index=index,columns=range(2))
  
  slice_list = [('A',0),('B',1)]
  </code></pre>
  <p>This doesn't work:</p>
  <pre><code>df.loc[slice_list,:]
  </code></pre>
  <p>I can get my expected result by doing boolean masking(?):</p>
  <pre><code>idx = (((df.index.get_level_values(0) == 'A')
     &amp; (df.index.get_level_values(1) == 0)) |
     ((df.index.get_level_values(0) == 'B')
      &amp; (df.index.get_level_values(1) == 1)))
  df.loc[idx]
  
  
  
           0    1
  A 0 c  NaN  NaN
      d  NaN  NaN
  B 1 c  NaN  NaN
      d  NaN  NaN
  </code></pre>
  <p>But I would much prefer a slicing option.</p>