title: xarray - Use groupby to group by every day over a year's climatological hourly netCDF data
body: <p>I have a hourly netCDF climatological data for a geographic extent over a year, e.g. from <code>2017-01-01T00:00:00</code> to <code>2017-12-31T23:00:00</code>.</p>
  
  <pre><code>&lt;xarray.Dataset&gt;
  Dimensions:    (latitude: 106, longitude: 193, time: 8760)
  Coordinates:
    * latitude   (latitude) float32 -39.2 -39.149525 ... -33.950478 -33.9
    * longitude  (longitude) float32 140.8 140.84792 140.89584 ... 149.95209 150.0
    * time       (time) datetime64[ns] 2017-01-01 ... 2017-12-31T23:00:00
  Data variables:
      T_SFC      (time, latitude, longitude) float32 dask.array&lt;shape=(8760, 106, 193), chunksize=(744, 106, 193)&gt;
  Attributes:
      creationTime:        1525708833
      creationTimeString:  Mon May  7 09:00:32 PDT 2018
      Conventions:         COARDS
  </code></pre>
  
  <p>As the it says well, the data has three coords (lat, lng and time) and a variable being hourly temperature.</p>
  
  <p>My code:</p>
  
  <pre><code>import xarray as xr
  mds_temp_path = '../Archive/*/IDV71000_VIC_T_SFC.nc'    # netCDF
  mds_temp = xr.open_mfdataset(mds_temp_path)    # open netCDF and read into a dataset object
  
  print(mds_temp.groupby('time.dayofyear').mean('time'))
  </code></pre>
  
  <p>What I got:</p>
  
  <pre><code>&lt;xarray.Dataset&gt;
  Dimensions:    (dayofyear: 365, latitude: 106, longitude: 193)
  Coordinates:
    * latitude   (latitude) float32 -39.2 -39.149525 ... -33.950478 -33.9
    * longitude  (longitude) float32 140.8 140.84792 140.89584 ... 149.95209 150.0
    * dayofyear  (dayofyear) int64 1 2 3 4 5 6 7 8 ... 359 360 361 362 363 364 365
  Data variables:
      T_SFC   (dayofyear, latitude, longitude) float64 dask.array&lt;shape=(365, 106, 193), chunksize=(1, 106, 193)&gt;
  </code></pre>
  
  <p>What I would like to achieve to be able to get a mean temperature value for every day, e.g. the time coordinate in the generated dataset being "2017-01-01", "2017-01-02", "2017-01-03", ... ..., "2017-12-31", instead of 1, 2, 3, ... ..., 365.</p>