html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/2419#issuecomment-499721397,https://api.github.com/repos/pydata/xarray/issues/2419,499721397,MDEyOklzc3VlQ29tbWVudDQ5OTcyMTM5Nw==,1197350,2019-06-07T00:52:10Z,2019-06-07T00:52:10Z,MEMBER,"> This was to facilitate looking at the max and min as a function of ""month"", take the difference, and then average over ""year""
What about
```python
gb = ds.groupby('time.year')
gb.max(dim='time') - gb.min(dim='time')
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,361237908
https://github.com/pydata/xarray/issues/2419#issuecomment-499716635,https://api.github.com/repos/pydata/xarray/issues/2419,499716635,MDEyOklzc3VlQ29tbWVudDQ5OTcxNjYzNQ==,1217238,2019-06-07T00:26:10Z,2019-06-07T00:26:10Z,MEMBER,"This can be done with a MultiIndex and `unstack()`, but yes right now it's definitely an awkward API.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,361237908
https://github.com/pydata/xarray/issues/2419#issuecomment-499699528,https://api.github.com/repos/pydata/xarray/issues/2419,499699528,MDEyOklzc3VlQ29tbWVudDQ5OTY5OTUyOA==,221526,2019-06-06T23:04:11Z,2019-06-06T23:04:11Z,CONTRIBUTOR,"So I ran into this working with a climate scientist the other day. The use case we had was given some model output that had data like:
```
[106831872 values with dtype=float32]
Coordinates:
* lat (lat) float32 -90.0 -89.057594 -88.11518 ... 89.057594 90.0
* lon (lon) float32 0.0 1.25 2.5 3.75 5.0 ... 355.0 356.25 357.5 358.75
* time (time) object 1850-02-01 00:00:00 ... 2011-01-01 00:00:00
```
we wanted to reshape to turn time into two dimensions (""year"", ""month""). This was to facilitate looking at the `max` and `min` as a function of ""month"", take the difference, and then average over ""year"". Is there a way to do this already that I'm not aware of?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,361237908
https://github.com/pydata/xarray/issues/2419#issuecomment-422473257,https://api.github.com/repos/pydata/xarray/issues/2419,422473257,MDEyOklzc3VlQ29tbWVudDQyMjQ3MzI1Nw==,1217238,2018-09-18T17:08:49Z,2018-09-18T17:08:49Z,MEMBER,"Can you give an more specific example use-case, e.g., before/after?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,361237908
https://github.com/pydata/xarray/issues/2419#issuecomment-422357134,https://api.github.com/repos/pydata/xarray/issues/2419,422357134,MDEyOklzc3VlQ29tbWVudDQyMjM1NzEzNA==,6815844,2018-09-18T11:29:31Z,2018-09-18T11:29:31Z,MEMBER,"Thanks for raising an issue, @dimitryx2017.
I like this idea.
We usually have methods rather than function.
Any idea about the API?
We usually use a keyword argument.
I'm thinking something like
`Ar.reshape(time=(('year', (2017, 2018)), ('month', np.arange(12)))`,
but it looks a little long...","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,361237908