title: Python Pandas rolling functions
body: <p>I am not sure I understand the parameter <code>min_periods</code> in Pandas <code>rolling</code> functions : why does it have to be smaller than the <code>window</code> parameter? 
  I would like to compute (for instance) the rolling max minus rolling min with a window of ten values BUT I want to wait maybe 20 values before starting computations: </p>
  
  <pre><code>In[1]:  import pandas as pd
  In[2]:  import numpy as np
  In[3]:  df = pd.DataFrame(columns=['A','B'], data=np.random.randint(low=0,high=100,size=(100,2)))
  In[4]:  roll = df['A'].rolling(window=10, min_periods=20)
  In[5]:  df['C'] = roll.max() - roll.min()
  
  In[6]:  roll
  Out[6]: Rolling [window=10,min_periods=20,center=False,axis=0]
  
  In[7]:  df['C'] = roll.max()-roll.min()
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>ValueError: Invalid min_periods size 20 greater than window 10
  </code></pre>
  
  <p>I thought that <code>min_periods</code> was there to tell how many values the function had to wait before starting computations. The documentation says:</p>
  
  <blockquote>
    <p>min_periods : int, default None</p>
    
    <p>Minimum number of observations in window required to have a value
    (otherwise result is NA)</p>
  </blockquote>
  
  <p>I had not been carefull to the "in window" detail here...
  Then what would be the most efficient way to achieve what I am trying to achieve? Should I do something like:</p>
  
  <pre><code>roll = df.loc[20:,'A'].rolling(window=10)
  df['C'] = roll.max() - roll.min()
  </code></pre>
  
  <p>Is there a more efficient way? </p>