title: DataFrame.loc() on MultiIndex doesn't work?
body: <p>I have a large DataFrame with a MultiIndex: Date and Stock. The DataFrame have many columns. Name the DataFrame <code>features</code>. Notice that the index has been sorted (I assume first by Date then by Stock).</p>
  
  <pre><code>features.sort_index(inplace=True)
  features
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SMXjI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SMXjI.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Now I want to get a slice of the DataFrame where all Date are within a time range. But apparently I'm doing something wrong and the result still contain Date outside the range.</p>
  
  <pre><code>df2 = features.copy()
  df2.loc[pd.IndexSlice[pd.IndexSlice[pd.Timestamp('2015-01-01'):pd.Timestamp('2015-12-31'), :], :]]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Puv4F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Puv4F.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Note that, strangely, if I remove most of the columns, the same <code>.loc</code> call successfully removes the rows w/ dates outside the time range.</p>
  
  <pre><code>df = features.loc[pd.IndexSlice[:, 'AAPL'], :]
  df.loc[pd.IndexSlice[pd.IndexSlice[pd.Timestamp('2015-01-01'):pd.Timestamp('2015-12-31'), :], :]]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1hUsI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1hUsI.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Question: am I doing anything wrong, or is it a bug?</p>
  
  <p>p.s.:</p>
  
  <pre><code>$ python --version
  Python 3.5.2
  
  $ python -c "import pandas as pd; print(pd.__version__)"
  0.18.1
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>It may have been a bug in pandas 0.18.1. The reason I'm saying this is that the problem went away after I upgrade to 0.19.2 (by <code>pip install --upgrade pandas</code>).</p>
  
  <p>Another possibility is that my ipython notebook needs a restart. However, I did try to restart the kernel and rerun the above code a few times before asking this question, so I tend to believe that this is not the reason.</p>