Skip to content

TST: GH 32431 check print label indexing on nan #36635

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

Merged
merged 5 commits into from
Nov 18, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pandas/tests/indexing/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,17 @@ def test_no_reference_cycle(self):
del df
assert wr() is None

def test_label_indexing_on_nan(self):
# GH 32431
df = pd.Series([1, "{1,2}", 1, None])
vc = df.value_counts(dropna=False)
result1 = vc.loc[np.nan]
result2 = vc[np.nan]

expected = 1
assert result1 == expected
assert result2 == expected


class TestSeriesNoneCoercion:
EXPECTED_RESULTS = [
Expand Down