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

Merged
merged 2 commits into from Nov 22, 2017

Conversation

Projects
None yet
3 participants
@topper-123
Contributor

topper-123 commented Nov 19, 2017

pivot_annual and isleapyear in tseries.util were deprecated in v0.19.

This PR removes them from the code base.

grouped = ts_hourly.groupby(ts_hourly.index.year)
hoy = grouped.apply(lambda x: x.reset_index(drop=True))
hoy = hoy.index.droplevel(0).values

This comment has been minimized.

@jreback

jreback Nov 19, 2017

Contributor

anything worthy of a test for these? eg maybe see if something similar using pivot_table (if not can u construct a test)

This comment has been minimized.

@topper-123

topper-123 Nov 20, 2017

Contributor

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.

@jreback jreback added the Deprecate label Nov 19, 2017

@jreback jreback referenced this pull request Nov 19, 2017

Open

DEPR: deprecations log for removed issues #13777

115 of 115 tasks complete

@topper-123 topper-123 changed the title from WIP: remove tseries.util.pivot_annual/isleapyear to CLN: remove tseries.util.pivot_annual/isleapyear Nov 19, 2017

@pep8speaks

This comment has been minimized.

pep8speaks commented Nov 20, 2017

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

This comment has been minimized.

codecov bot commented Nov 20, 2017

Codecov Report

Merging #18370 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.16% <ø> (-0.01%) ⬇️
#single 39.57% <ø> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <0%> (-0.1%) ⬇️
pandas/tseries/offsets.py 96.92% <0%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b00e62c...38ed067. Read the comment docs.

@codecov

This comment has been minimized.

codecov bot commented Nov 20, 2017

Codecov Report

Merging #18370 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.13% <ø> (-0.01%) ⬇️
#single 39.64% <ø> (-0.05%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4a2cd3...151c40c. Read the comment docs.

@topper-123

This comment has been minimized.

Contributor

topper-123 commented Nov 21, 2017

I've moved test_daily and test_monthly to testPivotTable from TestPivotAnnual. test_hourly could be moved as well, but I'll do that tomorrow.

@jreback jreback added this to the 0.22.0 milestone Nov 22, 2017

@jreback jreback merged commit 1543761 into pandas-dev:master Nov 22, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jreback

This comment has been minimized.

Contributor

jreback commented Nov 22, 2017

thanks @topper-123

@jreback

This comment has been minimized.

Contributor

jreback commented Nov 22, 2017

@topper-123 ok for a followup to move tests if you want.

@topper-123 topper-123 deleted the topper-123:remove_pivot_nnual_isleapyear branch Nov 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment