Skip to content
Merged
Changes from 3 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
8 changes: 8 additions & 0 deletions pandas/tests/indexing/multiindex/test_multiindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,11 @@ def test_multiindex_with_na_missing_key(self):
)
with pytest.raises(KeyError, match="missing_key"):
df[[("missing_key",)]]

def test_multiindex_from_tuples_with_nan(self):
# GH#23578
MultiIndex.from_tuples([("a", "b", "c"), np.nan, ("d", "", "")])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MultiIndex.from_tuples([("a", "b", "c"), np.nan, ("d", "", "")])
result = MultiIndex.from_tuples([("a", "b", "c"), np.nan, ("d", "", "")])

expected = MultiIndex.from_tuples(
[("a", "b", "c"), (np.nan, np.nan, np.nan), ("d", "", "")]
)
tm.assert_index_equal_result, expected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tm.assert_index_equal_result, expected
tm.assert_index_equal(result, expected)