Skip to content

Commit ee5e653

Browse files
jschendelpandres
authored andcommitted
Fix typos in test_interval_new (pandas-dev#20026)
1 parent 1ea5e2c commit ee5e653

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

pandas/tests/indexing/interval/test_interval_new.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
import numpy as np
3-
import pandas as pd
43

54
from pandas import Series, IntervalIndex, Interval
65
import pandas.util.testing as tm
@@ -170,17 +169,17 @@ def test_loc_with_overlap(self):
170169

171170
# interval
172171
expected = 0
173-
result = s.loc[pd.interval(1, 5)]
172+
result = s.loc[Interval(1, 5)]
174173
tm.assert_series_equal(expected, result)
175174

176-
result = s[pd.interval(1, 5)]
175+
result = s[Interval(1, 5)]
177176
tm.assert_series_equal(expected, result)
178177

179178
expected = s
180-
result = s.loc[[pd.interval(1, 5), pd.Interval(3, 7)]]
179+
result = s.loc[[Interval(1, 5), Interval(3, 7)]]
181180
tm.assert_series_equal(expected, result)
182181

183-
result = s[[pd.interval(1, 5), pd.Interval(3, 7)]]
182+
result = s[[Interval(1, 5), Interval(3, 7)]]
184183
tm.assert_series_equal(expected, result)
185184

186185
with pytest.raises(KeyError):
@@ -197,17 +196,17 @@ def test_loc_with_overlap(self):
197196

198197
# slices with interval (only exact matches)
199198
expected = s
200-
result = s.loc[pd.interval(1, 5):pd.Interval(3, 7)]
199+
result = s.loc[Interval(1, 5):Interval(3, 7)]
201200
tm.assert_series_equal(expected, result)
202201

203-
result = s[pd.interval(1, 5):pd.Interval(3, 7)]
202+
result = s[Interval(1, 5):Interval(3, 7)]
204203
tm.assert_series_equal(expected, result)
205204

206205
with pytest.raises(KeyError):
207-
s.loc[pd.interval(1, 6):pd.Interval(3, 8)]
206+
s.loc[Interval(1, 6):Interval(3, 8)]
208207

209208
with pytest.raises(KeyError):
210-
s[pd.interval(1, 6):pd.Interval(3, 8)]
209+
s[Interval(1, 6):Interval(3, 8)]
211210

212211
# slices with scalar raise for overlapping intervals
213212
# TODO KeyError is the appropriate error?
@@ -217,7 +216,7 @@ def test_loc_with_overlap(self):
217216
def test_non_unique(self):
218217

219218
idx = IntervalIndex.from_tuples([(1, 3), (3, 7)])
220-
s = pd.Series(range(len(idx)), index=idx)
219+
s = Series(range(len(idx)), index=idx)
221220

222221
result = s.loc[Interval(1, 3)]
223222
assert result == 0

0 commit comments

Comments
 (0)