-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Preserve None in Series unique #20893
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 4 commits
f33a4c5
9736ecb
f791e5e
1e83e60
df28111
f106b58
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 |
---|---|---|
|
@@ -1015,6 +1015,12 @@ def test_unique(self): | |
tm.assert_categorical_equal(s.unique(), pd.Categorical([np.nan]), | ||
check_dtype=False) | ||
|
||
def test_unique_obj_none_preservation(self): | ||
# GH 20866 | ||
s = pd.Series(['foo', None]) | ||
result = s.unique() | ||
assert result[1] is None | ||
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. construct array and compare. this should be in test_algorithms 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. Make sure to use 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. good point |
||
|
||
@pytest.mark.parametrize( | ||
"tc1, tc2", | ||
[ | ||
|
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 a comment here, checkull is specifically designed to catch ALL nulls here.