title: pandas: conditional select using .loc with MultiIndex
body: <p>I have read doc of <a href="https://pandas.pydata.org/pandas-docs/stable/advanced.html#advanced-indexing-with-hierarchical-index" rel="noreferrer">Advanced indexing with hierarchical index</a> where using <code>.loc</code> for <code>MultiIndex</code> is explained. Also this thread: <a href="https://stackoverflow.com/questions/24435788/using-loc-with-a-multiindex-in-pandas">Using .loc with a MultiIndex in pandas?</a></p>
  
  <p>Still I don't see how select rows where <code>(first index == some value) or (second index == some value)</code></p>
  
  <p>Example:</p>
  
  <pre><code>import pandas as pd
  
  index = pd.MultiIndex.from_arrays([['a', 'a', 'a', 'b', 'b', 'b'],
                                    ['a', 'b', 'c', 'a', 'b', 'c']],
                                    names=['i0', 'i1'])
  df = pd.DataFrame({'x': [1,2,3,4,5,6], 'y': [6,5,4,3,2,1]}, index=index)
  </code></pre>
  
  <p>Is this DataFrame:</p>
  
  <pre><code>       x  y
  i0 i1      
  a  a   1  6
     b   2  5
     c   3  4
  b  a   4  3
     b   5  2
     c   6  1
  </code></pre>
  
  <p>How can I get rows where <code>i0 == 'b' or i1 == 'b'</code>?</p>
  
  <pre><code>       x  y
  i0 i1      
  a  b   2  5
  b  a   4  3
     b   5  2
     c   6  1
  </code></pre>