Skip to content

Commit b640530

Browse files
toobazTomAugspurger
authored andcommitted
TST: test passing index (and other iterables) to .loc (#27120)
closes #16712
1 parent 989f912 commit b640530

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/frame/test_indexing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ def test_get_none(self, df):
7676
# see gh-5652
7777
assert df.get(None) is None
7878

79-
def test_loc_iterable(self, float_frame):
80-
idx = iter(['A', 'B', 'C'])
79+
@pytest.mark.parametrize('key_type', [iter, np.array, Series, Index])
80+
def test_loc_iterable(self, float_frame, key_type):
81+
idx = key_type(['A', 'B', 'C'])
8182
result = float_frame.loc[:, idx]
8283
expected = float_frame.loc[:, ['A', 'B', 'C']]
8384
assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)