title: Calculating Kendall's tau using scipy and groupby
body: <p>I have a csv file with precipitation data per year and per weather station.  It looks like this:</p>
  
  <pre><code>station_id    year       Sum
   210018      1916      65.024
   210018      1917      35.941
   210018      1918      28.448
   210018      1919      68.58
   210018      1920      31.115
   215400      1916      44.958
   215400      1917      31.496
   215400      1918      38.989
   215400      1919      74.93
   215400      1920      53.5432
  </code></pre>
  
  <p>I want to return a Kendall's tau correlation and p-value based upon unique station id's. So for above I want the correlation between sum and year for station id 210018 and 215400. </p>
  
  <p>The correlation for station_id 210018 would then be -.20 and a p-value of .62 and for station_id 215400 correlation would be .40 and a p-value of .33.  </p>
  
  <p>I am trying to use this:</p>
  
  <pre><code>grouped=df.groupby(['station_id'])
  grouped.aggregate([tau, p_value=sp.stats.kendalltau(df.year, df.Sum)])
  </code></pre>
  
  <p>The error returned is a syntax error on the equal sign after p_value.  </p>
  
  <p>Any help would be appreciated.</p>