title: Select N rows above and below a specific row in pandas
body: <p>I have this data frame and I want to select 10 rows before and after on a specific column. I have reached up to this point but I was wondering how to make it more elegant in a lambda python expression as I need to run this on a loop 10 thousand times.</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(data=np.random.rand(90),
       index=pd.date_range('2015-01-01','2015-03-31'),columns=['A'])
  </code></pre>
  
  <p>I have reached to this as an solution in progress:</p>
  
  <p>10 observations before and after:</p>
  
  <pre><code>df.loc['2015-01-17':].head(11)[1:11].transpose()   ! before
  df.loc[:'2015-01-17'].tail(11)[0:10].transpose()   ! after
  </code></pre>
  
  <p>So, how can I make this is in a loop with a lambda expression and having not only one <code>index</code> but two <code>indexes</code>?</p>