title: Rolling window with pandas
body: <p>I want to separate a dataset in the following fashion:</p>
  <pre><code>import pandas as pd
  import numpy as np
  
  df = pd.read_csv(&quot;https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv&quot;)
  
  sepal_length = df[&quot;sepal_length&quot;]
  sepal_length
  
  0      5.1
  1      4.9
  2      4.7
  3      4.6
  4      5.0
        ... 
  145    6.7
  146    6.3
  147    6.5
  148    6.2
  149    5.9
  Name: sepal_length, Length: 150, dtype: float64
  </code></pre>
  <p>I would like to create another dataset, trying to predict those values, based in 10 previous observations for instance (Suppose that this dataset is ordered and date dependant).</p>
  <p>So for my predictors, I would like to have another dataset having the 10 previous values for each index. this is:</p>
  <pre><code>10    x0 x1 x2 x3 x4 x5 x6 x7 x8 x9
  11    x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
  ...
  </code></pre>
  <p>where $ x_i $ is the sepal length at the i-th index.</p>