pull_requests: 1580738343
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1580738343 | PR_kwDOAMm_X85eOCcn | 8393 | closed | 0 | Port fix from pandas-dev/pandas#55283 to cftime resample | 6628425 | <!-- Feel free to remove check-list items aren't relevant to your change --> The remaining failing cftime resample tests in https://github.com/pydata/xarray/issues/8091 happen to be related to a bug that was fixed in the pandas implementation, https://github.com/pandas-dev/pandas/pull/55283, leading answers to change in some circumstances. This PR ports that bug fix to xarray's implementation of resample for data indexed by a `CFTimeIndex`. - [x] Fixes remaining failing cftime resample tests in https://github.com/pydata/xarray/issues/8091 - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` A simple example where answers change in pandas is the following: #### Previously ``` >>> import numpy as np; import pandas as pd >>> index = pd.date_range("2000", periods=5, freq="5D") >>> series = pd.Series(np.arange(index.size), index=index) >>> series.resample("2D", closed="right", label="right", offset="1s").mean() 2000-01-01 00:00:01 0.0 2000-01-03 00:00:01 NaN 2000-01-05 00:00:01 1.0 2000-01-07 00:00:01 NaN 2000-01-09 00:00:01 NaN 2000-01-11 00:00:01 2.0 2000-01-13 00:00:01 NaN 2000-01-15 00:00:01 3.0 2000-01-17 00:00:01 NaN 2000-01-19 00:00:01 NaN 2000-01-21 00:00:01 4.0 Freq: 2D, dtype: float64 ``` #### Currently ``` >>> import numpy as np; import pandas as pd >>> index = pd.date_range("2000", periods=5, freq="5D") >>> series = pd.Series(np.arange(index.size), index=index) >>> series.resample("2D", closed="right", label="right", offset="1s").mean() 2000-01-01 00:00:01 0.0 2000-01-03 00:00:01 NaN 2000-01-05 00:00:01 NaN 2000-01-07 00:00:01 1.0 2000-01-09 00:00:01 NaN 2000-01-11 00:00:01 2.0 2000-01-13 00:00:01 NaN 2000-01-15 00:00:01 NaN 2000-01-17 00:00:01 3.0 2000-01-19 00:00:01 NaN 2000-01-21 00:00:01 4.0 Freq: 2D, dtype: float64 ``` This PR allows us to reproduce this change in xarray for data indexed by a `CFTimeIndex`. The bin edges were incorrect in the previous case; see https://github.com/pandas-dev/pandas/pull/52064#issuecomment-1785893752 for @MarcoGorelli's nice explanation as to why. | 2023-10-31T11:12:09Z | 2023-11-02T09:40:46Z | 2023-11-02T04:12:51Z | 2023-11-02T04:12:51Z | d933578ebdc4105a456bada4864f8ffffd7a2ced | 0 | 264c41108ffe770bb5a182e2f6c882596fb9cdad | cfe4d71fae70930ac6776bd53fe2a93875a84515 | MEMBER | 13221727 | https://github.com/pydata/xarray/pull/8393 |
Links from other tables
- 3 rows from pull_requests_id in labels_pull_requests