-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Fix resample with np.timedelta64 loffset has no effect #18708
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
BUG: Fix resample with np.timedelta64 loffset has no effect #18708
Conversation
Hello @Licht-T! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on December 10, 2017 at 02:51 Hours UTC |
3f2ccbc
to
77cba2b
Compare
@@ -1051,6 +1051,8 @@ def __init__(self, freq='Min', closed=None, label=None, how='mean', | |||
|
|||
if isinstance(loffset, compat.string_types): | |||
loffset = to_offset(loffset) | |||
elif isinstance(loffset, np.timedelta64): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better to do the conversion up front
Timedelta already handles these conversions (timedelta and np.timedelta)
offsets should continue to use to_offset
as those are converted to absolute days for Timedelta
loffset=timedelta(minutes=1)).mean() | ||
# GH7687 | ||
result1 = s.resample('5min', closed='right', label='right', | ||
loffset=np.timedelta64(1, 'm')).mean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameterize
Codecov Report
@@ Coverage Diff @@
## master #18708 +/- ##
==========================================
- Coverage 91.6% 91.56% -0.05%
==========================================
Files 153 153
Lines 51273 51275 +2
==========================================
- Hits 46970 46949 -21
- Misses 4303 4326 +23
Continue to review full report at Codecov.
|
can you also test for some invalid offsets |
closing as stale. if you want to continue working, pls ping. |
git diff upstream/master -u -- "*.py" | flake8 --diff