title: calculate variance and standar deviation of each 15 rows in python
body: <p>I have a dataframe which contains 300 value of height and I want to calculate the standard deviation and also variance of each 15 rows. I supposed to have 20 var and st.deviation. So far I have done like the written script, but it doesn't work. I think my problem is on how should I call the standard deviation and variance, because when I did to calculate mean and median the script works fine. How can I fix it by using python? thankyou</p>
  <pre><code>import statistics
  grouper = df.groupby(df.index // 15)
  df_var = grouper.agg( 
          statistics.pstdev(df[&quot;height&quot;])
         ,statistics.stdev(df[&quot;height&quot;])
  )
  </code></pre>