Skip to content
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: grouby(axis=1) cannot select column names #27700

Merged
merged 8 commits into from
Aug 2, 2019

Conversation

charlesdong1991
Copy link
Member

@charlesdong1991 charlesdong1991 commented Aug 1, 2019

@pep8speaks
Copy link

pep8speaks commented Aug 1, 2019

Hello @charlesdong1991! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-08-02 07:54:46 UTC

@@ -166,6 +166,7 @@ Groupby/resample/rolling

-
-
- Bug in :meth:`groupby` does not offer implicit selection by column names when ``axis`` set to 1 (:issue:`27614)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be DataFrame.groupby`

"does not offer" to "not offering"

"axis set to 1" to "axis=1"

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also not sure what "implicit selection by column name" means here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm also not sure what "implicit selection by column name" means here.

ahh, my bad, i basically just copied and pasted the issue title, will change! @TomAugspurger thanks for your quick reply!

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Nice looking PR! Can you add a test case for a multi index column as well?

@WillAyd WillAyd added the Groupby label Aug 1, 2019
@WillAyd WillAyd added this to the 1.0 milestone Aug 1, 2019
@codecov
Copy link

codecov bot commented Aug 2, 2019

Codecov Report

Merging #27700 into master will decrease coverage by 50.51%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #27700       +/-   ##
===========================================
- Coverage      93%   42.49%   -50.52%     
===========================================
  Files         182      182               
  Lines       50195    50195               
===========================================
- Hits        46686    21328    -25358     
- Misses       3509    28867    +25358
Flag Coverage Δ
#multiple ?
#single 42.49% <0%> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby/grouper.py 18.38% <0%> (-80.15%) ⬇️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/io/gcs.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/s3.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-99.38%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.16%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.1%) ⬇️
... and 137 more

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 95be01d...1413929. Read the comment docs.

@charlesdong1991
Copy link
Member Author

charlesdong1991 commented Aug 2, 2019

@WillAyd @TomAugspurger I added tests for MI columns, and seems work well and pass all tests! Feel free to take a look again!

@jreback jreback merged commit 1fa1ad9 into pandas-dev:master Aug 2, 2019
@jreback
Copy link
Contributor

jreback commented Aug 2, 2019

thanks @charlesdong1991

@jreback
Copy link
Contributor

jreback commented Aug 2, 2019

these might be closable now: #21127, #17961, #13420, #3689

@charlesdong1991
Copy link
Member Author

charlesdong1991 commented Aug 2, 2019

thanks for merge!
I will double check those cases @jreback shall I create another PR to add test for those cases? If tests not passed, then I will create other PRs to debug and fix those issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GroupBy(axis=1) Does Not Offer Implicit Selection By Columns Name(s)
5 participants