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

Added repr string for Grouper and TimeGrouper #18203

Merged
merged 1 commit into from Nov 27, 2017

Conversation

Projects
None yet
4 participants
@topper-123
Contributor

topper-123 commented Nov 9, 2017

  • closes #xxxx
  • tests added / passed
  • [x ] passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

This is a new implementation of #17727. This is much simpler than the previous attempts. The outputs are now:

>>> pd.Grouper(key='A')
Grouper(key='A')
>>> pd.Grouper(key='A', freq='2T')
TimeGrouper(key='A', freq=<2 * Minutes>, sort=True, closed='left', label='left', convention='e')

Tests still need to be written. I can do them when/if this is ok.

@jreback jreback referenced this pull request Nov 9, 2017

Closed

repr string for pd.Grouper #17727

0 of 2 tasks complete
Show outdated Hide outdated pandas/core/groupby.py Outdated
@pep8speaks

This comment has been minimized.

Show comment
Hide comment
@pep8speaks

pep8speaks Nov 9, 2017

Hello @topper-123! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on November 27, 2017 at 01:12 Hours UTC

pep8speaks commented Nov 9, 2017

Hello @topper-123! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on November 27, 2017 at 01:12 Hours UTC
@topper-123

This comment has been minimized.

Show comment
Hide comment
@topper-123

topper-123 Nov 9, 2017

Contributor

After changes according to @jreback, the output is now:

>>> pd.Grouper(key='A')
Grouper(key='A', level=None, freq=None, axis=0, sort=False)
>>> pd.Grouper(key='A', freq='H')
TimeGrouper(key='A', level=None, freq=<Hour>, sort=True, closed='left', label='left', how='mean', nperiods=None, axis=0, fill_method=None, limit=None, loffset=None, kind=None, convention='e', base=0)
Contributor

topper-123 commented Nov 9, 2017

After changes according to @jreback, the output is now:

>>> pd.Grouper(key='A')
Grouper(key='A', level=None, freq=None, axis=0, sort=False)
>>> pd.Grouper(key='A', freq='H')
TimeGrouper(key='A', level=None, freq=<Hour>, sort=True, closed='left', label='left', how='mean', nperiods=None, axis=0, fill_method=None, limit=None, loffset=None, kind=None, convention='e', base=0)
@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Nov 10, 2017

Contributor

so what you can do is skip printing attributes that are None
makes it’s shorter w/o loss of generality

Contributor

jreback commented Nov 10, 2017

so what you can do is skip printing attributes that are None
makes it’s shorter w/o loss of generality

Show outdated Hide outdated pandas/core/groupby.py Outdated
Show outdated Hide outdated pandas/core/resample.py Outdated
Show outdated Hide outdated pandas/tests/test_resample.py Outdated
@jreback

see my other comments

Show outdated Hide outdated doc/source/whatsnew/v0.21.1.txt Outdated
@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Nov 25, 2017

Contributor

can you rebase

Contributor

jreback commented Nov 25, 2017

can you rebase

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Nov 26, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@38f41e6). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #18203   +/-   ##
=========================================
  Coverage          ?   91.38%           
=========================================
  Files             ?      163           
  Lines             ?    50066           
  Branches          ?        0           
=========================================
  Hits              ?    45753           
  Misses            ?     4313           
  Partials          ?        0
Flag Coverage Δ
#multiple 89.19% <100%> (?)
#single 40.36% <100%> (?)
Impacted Files Coverage Δ
pandas/core/groupby.py 92.03% <100%> (ø)
pandas/core/resample.py 96.16% <100%> (ø)

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 38f41e6...833883f. Read the comment docs.

codecov bot commented Nov 26, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@38f41e6). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #18203   +/-   ##
=========================================
  Coverage          ?   91.38%           
=========================================
  Files             ?      163           
  Lines             ?    50066           
  Branches          ?        0           
=========================================
  Hits              ?    45753           
  Misses            ?     4313           
  Partials          ?        0
Flag Coverage Δ
#multiple 89.19% <100%> (?)
#single 40.36% <100%> (?)
Impacted Files Coverage Δ
pandas/core/groupby.py 92.03% <100%> (ø)
pandas/core/resample.py 96.16% <100%> (ø)

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 38f41e6...833883f. Read the comment docs.

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Nov 26, 2017

Codecov Report

Merging #18203 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18203      +/-   ##
==========================================
- Coverage   91.35%   91.33%   -0.02%     
==========================================
  Files         163      163              
  Lines       49796    49797       +1     
==========================================
- Hits        45490    45482       -8     
- Misses       4306     4315       +9
Flag Coverage Δ
#multiple 89.13% <100%> (ø) ⬆️
#single 40.79% <100%> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby.py 92.03% <100%> (ø) ⬆️
pandas/core/resample.py 96.34% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <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 f745e52...bdc5ac2. Read the comment docs.

codecov bot commented Nov 26, 2017

Codecov Report

Merging #18203 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18203      +/-   ##
==========================================
- Coverage   91.35%   91.33%   -0.02%     
==========================================
  Files         163      163              
  Lines       49796    49797       +1     
==========================================
- Hits        45490    45482       -8     
- Misses       4306     4315       +9
Flag Coverage Δ
#multiple 89.13% <100%> (ø) ⬆️
#single 40.79% <100%> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby.py 92.03% <100%> (ø) ⬆️
pandas/core/resample.py 96.34% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <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 f745e52...bdc5ac2. Read the comment docs.

Show outdated Hide outdated pandas/core/resample.py Outdated
@jreback

lgtm. some comments.

Show outdated Hide outdated pandas/tests/test_resample.py Outdated
Show outdated Hide outdated pandas/tests/test_resample.py Outdated
@topper-123

This comment has been minimized.

Show comment
Hide comment
@topper-123

topper-123 Nov 26, 2017

Contributor

green.

Contributor

topper-123 commented Nov 26, 2017

green.

@jreback jreback modified the milestones: 0.22.0, 0.21.1 Nov 26, 2017

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Nov 26, 2017

Contributor

linting issue. otherwise lgtm. note that you can do

make lint-diff to see linting in your patch, locally

Contributor

jreback commented Nov 26, 2017

linting issue. otherwise lgtm. note that you can do

make lint-diff to see linting in your patch, locally

Show outdated Hide outdated pandas/core/resample.py Outdated
@topper-123

This comment has been minimized.

Show comment
Hide comment
@topper-123

topper-123 Nov 27, 2017

Contributor

All green, @jreback

Contributor

topper-123 commented Nov 27, 2017

All green, @jreback

@jreback jreback merged commit f7c79be into pandas-dev:master Nov 27, 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.

Show comment
Hide comment
@jreback

jreback Nov 27, 2017

Contributor

thanks!

Contributor

jreback commented Nov 27, 2017

thanks!

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

TomAugspurger added a commit to TomAugspurger/pandas that referenced this pull request Dec 8, 2017

TomAugspurger added a commit that referenced this pull request Dec 11, 2017

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