title: pyspark dataframe, groupby and compute variance of a column
body: <p>I would like to groupby a pyspark dataframe and compute the variance of a specific column. For the average this is quite easy and can be done like this</p>
  
  <pre><code>from pyspark.sql import functions as func
  AVERAGES=df.groupby('country').agg(func.avg('clicks').alias('avg_clicks')).collect()
  </code></pre>
  
  <p>however for the variance there seem not to be any aggregation function in the function sub-module (I am also wondering why since this is quite a common operation)</p>