title: Pandas rolling window to return an array
body: <p>Here is a sample code.    </p>
  
  <pre><code>df = pd.DataFrame(np.random.randn(10, 2), columns=list('AB'))
  df['C'] = df.B.rolling(window=3)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>           A         B                                       C
  0 -0.108897  1.877987  Rolling [window=3,center=False,axis=0]
  1 -1.276055 -0.424382  Rolling [window=3,center=False,axis=0]
  2  1.578561 -1.094649  Rolling [window=3,center=False,axis=0]
  3 -0.443294  1.683261  Rolling [window=3,center=False,axis=0]
  4  0.674124  0.281077  Rolling [window=3,center=False,axis=0]
  5  0.587773  0.697557  Rolling [window=3,center=False,axis=0]
  6 -0.258038 -1.230902  Rolling [window=3,center=False,axis=0]
  7 -0.443269  0.647107  Rolling [window=3,center=False,axis=0]
  8  0.347187  0.753585  Rolling [window=3,center=False,axis=0]
  9 -0.369179  0.975155  Rolling [window=3,center=False,axis=0]
  </code></pre>
  
  <p>I want my 'C' column to be an array like [0.1231, -1.132, 0.8766].
  I tried using rolling apply but in vain.</p>
  
  <p>Expected Output:</p>
  
  <pre><code>       A         B                 C
  0 -0.108897  1.877987  []
  1 -1.276055 -0.424382  []
  2  1.578561 -1.094649  [-1.094649, -0.424382, 1.877987]
  3 -0.443294  1.683261  [1.683261, -1.094649, -0.424382]
  4  0.674124  0.281077  [0.281077, 1.683261, -1.094649]
  5  0.587773  0.697557  [0.697557, 0.281077, 1.683261]
  6 -0.258038 -1.230902  [-1.230902, 0.697557, 0.281077]
  7 -0.443269  0.647107  [0.647107, -1.230902, 0.697557]
  8  0.347187  0.753585  [0.753585, 0.647107, -1.230902]
  9 -0.369179  0.975155  [0.975155, 0.753585, 0.647107]
  </code></pre>