Skip to content
Open
Changes from all 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
10 changes: 10 additions & 0 deletions pandas/tests/indexing/interval/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,13 @@ def test_reindex_behavior_with_interval_index(self, base):
expected_result = Series([np.nan, 0], index=[np.nan, 1.0], dtype=float)
result = ser.reindex(index=[np.nan, 1.0])
tm.assert_series_equal(result, expected_result)

def test_multiindex_with_interval_index(self):
# for GH#25298
intIndex = IntervalIndex.from_arrays([1, 5, 8, 13, 16], [4, 9, 12, 17, 20])
multiIndex = pd.MultiIndex.from_arrays([["a", "a", "b", "b", "c"], intIndex])
data = [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)]
df = DataFrame(data, index=multiIndex)
result1 = df.loc[("b", 16)]
expected = Series([7, 8])
tm.assert_series_equal(result1, expected, check_names=False)
Comment on lines +233 to +234
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a name= to the Series so we do not need to call check_names=False?

Loading