-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Test that nan value counts are included when dropna=False. GH#31944 #36783
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,3 +274,12 @@ def test_value_counts_datetime64(index_or_series): | |
td2 = klass(td2, name="dt") | ||
result2 = td2.value_counts() | ||
tm.assert_series_equal(result2, expected_s) | ||
|
||
|
||
def test_value_counts_nan(index_or_series): | ||
"""Test that nan value counts are included when dropna=False. GH#31944""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
klass = index_or_series | ||
s_values = [True, pd.NA, np.nan] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. call this |
||
s = klass(s_values) | ||
expected = Series([2, 1], index=[pd.NA, True]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit-pick: can you move this to after res There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, makes sense! |
||
tm.assert_series_equal(s.value_counts(dropna=False), expected) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you wanna define |
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'd call it
test_value_counts_with_nan