Skip to content

Commit 456ae7c

Browse files
committed
move test
1 parent 0325998 commit 456ae7c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

pandas/tests/indexing/interval/test_interval.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,13 @@ def test_reindex_behavior_with_interval_index(self, base):
222222
expected_result = Series([np.nan, 0], index=[np.nan, 1.0], dtype=float)
223223
result = ser.reindex(index=[np.nan, 1.0])
224224
tm.assert_series_equal(result, expected_result)
225+
226+
def test_multiindex_with_interval_index(self):
227+
# for GH#25298
228+
intIndex = IntervalIndex.from_arrays([1, 5, 8, 13, 16], [4, 9, 12, 17, 20])
229+
multiIndex = pd.MultiIndex.from_arrays([["a", "a", "b", "b", "c"], intIndex])
230+
data = [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)]
231+
df = DataFrame(data, index=multiIndex)
232+
series1 = df.loc[("b", 16)]
233+
series2 = df.loc["b"].loc[16]
234+
tm.assert_equal(series1.array, series2.array)

pandas/tests/indexing/multiindex/test_multiindex.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
CategoricalDtype,
99
DataFrame,
1010
Index,
11-
IntervalIndex,
1211
MultiIndex,
1312
Series,
1413
)
@@ -293,13 +292,3 @@ def test_multiindex_assign_alignment_with_non_string_dtype(self):
293292
)
294293

295294
tm.assert_frame_equal(meta, result)
296-
297-
def test_multiindex_with_interval_index(self):
298-
# for https://github.com/pandas-dev/pandas/issues/25298
299-
intIndex = IntervalIndex.from_arrays([1, 5, 8, 13, 16], [4, 9, 12, 17, 20])
300-
multiIndex = MultiIndex.from_arrays([["a", "a", "b", "b", "c"], intIndex])
301-
data = [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)]
302-
df = DataFrame(data, index=multiIndex)
303-
series1 = df.loc[("b", 16)]
304-
series2 = df.loc["b"].loc[16]
305-
tm.assert_equal(series1.array, series2.array)

0 commit comments

Comments
 (0)