-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
ENH: pivot/groupby index with nan (GH3729) #21669
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21669 +/- ##
==========================================
+ Coverage 91.9% 91.9% +<.01%
==========================================
Files 154 154
Lines 49656 49663 +7
==========================================
+ Hits 45637 45644 +7
Misses 4019 4019
Continue to review full report at Codecov.
|
expected_na = Series([4, 2, 4], index=['bar', 'foo', np.nan]) | ||
|
||
assert_series_equal(agged_na, expected_na, check_dtype=False) | ||
|
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.
Reference issue number in a comment.
name='Vals' | ||
) | ||
assert_series_equal(agged_na, expected_na, check_dtype=False) | ||
|
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.
Reference issue number in a comment.
uniques = np.resize(uniques, len(uniques) + 1) | ||
uniques[-1] = np.nan | ||
labels = np.where(labels == na_sentinel, new_na_sentinel, labels) | ||
|
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.
Given that you're using broadcasting and NumPy
, I don't think we should have any performance issues, but I wonder if we should still add a benchmark test anyway.
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.
needs quite a bit of tests & to parameterize existing tests to accept nan groups. i don't like the keyword at all. haven't reviewed fully.
Happy to change the name if you like, what don't you like about it? Or do
you have a suggested different keyword?
…On Wed., 4 Jul. 2018, 01:01 Jeff Reback, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
needs quite a bit of tests & to parameterize existing tests to accept nan
groups. i don't like the keyword at all. haven't reviewed fully.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21669 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD615yfHPDUVnSdwQjtSkJzSMzh3SI7Bks5uC4csgaJpZM4U8YHP>
.
|
this needs to be |
@andrewdalecramer |
can you rebase this |
this is a nice feature, but needs quite a bit of work to fully test this out. closing as stale. if you'd like to continue, pls ping. |
Adds the ability to use NaN as a grouping variable. Required allowing NA as a factorisation variable in
factorize()
.git diff upstream/master -u -- "*.py" | flake8 --diff