pull_requests: 672129768
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
672129768 | MDExOlB1bGxSZXF1ZXN0NjcyMTI5NzY4 | 5480 | open | 0 | Implement weighted groupby | 2448579 | <!-- Feel free to remove check-list items aren't relevant to your change --> - xref #3937 - [ ] Tests added - [ ] Passes `pre-commit run --all-files` - [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` Initial proof-of-concept. Suggestions to improve this are very welcome. Here's some convenient testing code ``` python import xarray as xr ds = xr.tutorial.open_dataset('rasm').load() month_length = ds.time.dt.days_in_month weights = month_length.groupby('time.season') / month_length.groupby('time.season').sum() actual = ds.weighted(month_length).groupby("time.season").mean() expected = (ds * weights).groupby('time.season').sum(skipna=False) xr.testing.assert_allclose(actual, expected) ``` I've added info to the repr ``` python ds.weighted(month_length).groupby("time.season") ``` ``` WeightedDatasetGroupBy, grouped over 'season' 4 groups with labels 'DJF', 'JJA', 'MAM', 'SON'. weighted along dimensions: time by 'days_in_month' ``` | 2021-06-17T02:57:17Z | 2023-07-27T18:09:55Z | 59e351eae6b2d79bab8d097aa01a2c9dfd7bb7b1 | 1 | f2de9911d4334d3ea20f068496ae7c17da57b028 | d1e4164f3961d7bbb3eb79037e96cae14f7182f8 | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/5480 |
Links from other tables
- 1 row from pull_requests_id in labels_pull_requests