Skip to content

Commit e803ba1

Browse files
committed
TST: Remove .ix deprecation warnings
Partially addresses pandas-devgh-21137.
1 parent bc37ea2 commit e803ba1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pandas/tests/frame/test_indexing.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,13 @@ def test_getitem_setitem_ix_negative_integers(self):
397397

398398
df = DataFrame(np.random.randn(8, 4))
399399
# ix does label-based indexing when having an integer index
400-
with pytest.raises(KeyError):
401-
df.ix[[-1]]
400+
with catch_warnings(record=True):
401+
with pytest.raises(KeyError):
402+
df.ix[[-1]]
402403

403-
with pytest.raises(KeyError):
404-
df.ix[:, [-1]]
404+
with catch_warnings(record=True):
405+
with pytest.raises(KeyError):
406+
df.ix[:, [-1]]
405407

406408
# #1942
407409
a = DataFrame(randn(20, 2), index=[chr(x + 65) for x in range(20)])

pandas/tests/indexing/test_indexing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def test_dups_fancy_indexing(self):
197197
# List containing only missing label
198198
dfnu = DataFrame(np.random.randn(5, 3), index=list('AABCD'))
199199
with pytest.raises(KeyError):
200-
dfnu.ix[['E']]
200+
dfnu.loc[['E']]
201201

202202
# ToDo: check_index_type can be True after GH 11497
203203

0 commit comments

Comments
 (0)