Skip to content

.resample now supports loffset. #2608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 19, 2018
Merged

Conversation

dcherian
Copy link
Contributor

  • Tests added
  • Fully documented, including whats-new.rst for all changes and api.rst for new API

@pep8speaks
Copy link

Hello @dcherian! Thanks for submitting the PR.

dcherian and others added 4 commits December 14, 2018 14:07
…ture/loffset

* 'feature/loffset' of github.com:dcherian/xarray:
  Update whats-new.rst
@@ -700,7 +703,8 @@ def resample(self, indexer=None, skipna=None, closed=None, label=None,

group = DataArray(dim_coord, coords=dim_coord.coords,
dims=dim_coord.dims, name=RESAMPLE_DIM)
grouper = pd.Grouper(freq=freq, closed=closed, label=label, base=base)
grouper = pd.Grouper(freq=freq, closed=closed, label=label, base=base,
loffset=pd.tseries.frequencies.to_offset(loffset))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this explicit cast with pd.tseries.frequencies.to_offset? I guess it's safe to use since it's listed in the pandas API docs explicitly, but I get a little nervous about digging into internals in other projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed for pandas 0.19.2 which is our minimum version. on 0.23 pandas does the cast automatically.

@shoyer shoyer merged commit 778ffc4 into pydata:master Dec 19, 2018
dcherian pushed a commit to yohai/xarray that referenced this pull request Dec 19, 2018
* master:
  .resample now supports loffset. (pydata#2608)
  Remove failing Appveyor Python 2.7 32-bit build (pydata#2617)
  Remove meaningless tz argument in cftime_range (pydata#2613)
  doc fixes. (pydata#2611)
  Fix parsing '_Unsigned' attribute (pydata#2584)
  fix a few typos in rst files (pydata#2607)
@spencerkclark spencerkclark mentioned this pull request Jan 22, 2019
3 tasks
@dcherian dcherian deleted the feature/loffset branch April 12, 2019 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants