title: pandas dataframe by boolean value, by index, and by integer
body: <p>I have a similar problem to the one here <a href="https://stackoverflow.com/questions/33487932/pandas-dataframe-by-index-and-integer">(dataframe by index and by integer)</a></p>
  
  <p>What I want is to get part of the DataFrame by a boolean indexing (easy) and look at a few values backward, say at the previous index and possibly a few more. Unfortunately, the suggested answer in the linked question with <code>get_loc</code> makes my code snippet choke (type error in the following snippet) before I can get the actual integer locations.</p>
  
  <p>Taking the same example as in the answer in the other question, here is what I tried:</p>
  
  <pre><code>df = pd.DataFrame(index=pd.date_range(start=dt.datetime(2015,1,1), end=dt.datetime(2015,2,1)), data={'a':np.arange(32)})
  df.index.get_loc(df.index[df['a'] == 1])
  *** TypeError: Cannot convert input to TimeStamp
  </code></pre>
  
  <p>The previous answer used a string for <code>get_loc</code> where I'd just like to pass a plain index value (here a DateTime) </p>