-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
CLN: remove tseries.util.pivot_annual/isleapyear #18370
CLN: remove tseries.util.pivot_annual/isleapyear #18370
Conversation
8e0d4ee
to
9310f0f
Compare
|
||
grouped = ts_hourly.groupby(ts_hourly.index.year) | ||
hoy = grouped.apply(lambda x: x.reset_index(drop=True)) | ||
hoy = hoy.index.droplevel(0).values |
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.
anything worthy of a test for these? eg maybe see if something similar using pivot_table (if not can u construct a test)
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.
A point is that pivot_table
requires dataframes, and pivot_annual
works on series [that need to have a DatetimeIndex]. So pivot_table
is strictly speaking not doing the same as pivot_annual
.
A deeper second issue is that pivot_annual
dayofyear number 60 is always febr. 29, while for other pandas date functionality day 60 switches between febr. 29 and 1.mars , depending on whether we're not having a leap year or not.
I'll take a look into if something can be moved. However, do you not think that such date functionality is checked other places, i..e. we duplicate datetime tests by adding them to TestPivotTable
? See for example TestPivotTable.test_pivot_timegrouper
, line 716 for some date pivot_table tests.
Hello @topper-123! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on November 21, 2017 at 21:05 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #18370 +/- ##
==========================================
- Coverage 91.38% 91.36% -0.03%
==========================================
Files 164 163 -1
Lines 49790 49753 -37
==========================================
- Hits 45501 45455 -46
- Misses 4289 4298 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18370 +/- ##
==========================================
- Coverage 91.36% 91.34% -0.03%
==========================================
Files 164 163 -1
Lines 49733 49690 -43
==========================================
- Hits 45439 45387 -52
- Misses 4294 4303 +9
Continue to review full report at Codecov.
|
9252308
to
275c25a
Compare
I've moved |
275c25a
to
151c40c
Compare
thanks @topper-123 |
@topper-123 ok for a followup to move tests if you want. |
pivot_annual
andisleapyear
intseries.util
were deprecated in v0.19.This PR removes them from the code base.