issue_comments: 652898319
This data as json
| 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/2852#issuecomment-652898319 | https://api.github.com/repos/pydata/xarray/issues/2852 | 652898319 | MDEyOklzc3VlQ29tbWVudDY1Mjg5ODMxOQ== | 20053498 | 2020-07-02T09:29:32Z | 2020-07-02T09:29:55Z | NONE | I'm going to share a code snippet that might be useful to people reading this issue. I wanted to group my data by month and year, and take the mean for each group. I did not want to use My solution was to use Here is the code: ``` def _grouped_mean( data: np.ndarray, months: np.ndarray, years: np.ndarray) -> np.ndarray: """similar to grouping year_month MultiIndex, but faster.
def _wrapped_grouped_mean(da: xr.DataArray) -> xr.DataArray: """similar to grouping by a year_month MultiIndex, but faster.
``` |
{
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 1,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
425320466 |