-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Dropna argument is now respected when false in pivot_table #25738
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25738 +/- ##
==========================================
- Coverage 91.25% 91.24% -0.01%
==========================================
Files 172 172
Lines 52973 52973
==========================================
- Hits 48338 48337 -1
- Misses 4635 4636 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25738 +/- ##
==========================================
- Coverage 91.89% 91.89% -0.01%
==========================================
Files 175 175
Lines 52509 52509
==========================================
- Hits 48255 48252 -3
- Misses 4254 4257 +3
Continue to review full report at Codecov.
|
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.
Can we clarify the meaning of dropna
? From the docstring:
dropna : boolean, default True
Do not include columns whose entries are all NaN
It's not clear (to me) what "columns" is referring to. Input columns? Columns after some internal reshaping? Columns at the very end?
Hello @alexander-ponomaroff! 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-04-12 17:46:52 UTC |
The resulting pivot table will not contain any columns with NaN values if the dropna argument is True. I believe would be the answer. I can look into it in more detail if this answer doesn't clarify it or is not specific enough. |
@jreback @TomAugspurger Do you have any other requests and/or feedback for this PR? |
can you merge master and update |
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.
lgtm @jreback
True, False | ||
]) | ||
def test_pivot_table_aggfunc_dropna(self, dropna): | ||
# GH 22159 |
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.
do we have a sufficient test when aggfunc is just a scalar? if not can you add
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.
@jreback I'm not sure what you mean by this. How can aggfunc be a scalar? Could you please elaborate on this?
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.
@alexander-ponomaroff for example when aggfunc=np.sum
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.
@WillAyd Thank you, it doesn't seem like there is a test with dropna and scalar aggfunc together. So I will add one right now.
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.
I added a second test, where aggfunc=np.mean
. Please take a look and let me know if it's sufficient.
thanks @alexander-ponomaroff |
git diff upstream/master -u -- "*.py" | flake8 --diff