title: Compute annual mean using x-arrays
body: <p>I have a <code>python xarray</code> dataset with <code>time,x,y</code> for its dimensions and <code>value1</code> as its variable.  I'm trying to compute annual mean of <code>value1</code> for each <code>x,y</code> coordinate pair.  </p>
  
  <p>I've run into this function while reading the docs:  </p>
  
  <pre><code>ds.groupby('time.year').mean()  
  </code></pre>
  
  <p>This seems to compute a single annual mean for <strong>all</strong> <code>x,y</code> coordinate pairs in <code>value1</code> at each given time slice<br>
  rather than the annual means of <strong>individual</strong> <code>x,y</code> coordinate pairs at each given time slice.</p>
  
  <p>While the code snippet above produces the wrong output,  I'm very interested in its oversimplified form.  I would really like to figure out the "X-arrays trick" to doing annual mean for a given <code>x,y</code> coordinate pair rather than hacking it together myself.  </p>
  
  <p>Cam someone point me in the right direction? Should I temporarily turn this into a <code>pandas</code> object? </p>