Skip to content

Commit 3a3b21d

Browse files
committed
adding test case for pandas-dev#899
1 parent 0cf1cb9 commit 3a3b21d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_series.py

+14
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ def test_multiindex_loc() -> None:
176176
check(assert_type(s.loc[1, "a"], int), np.int_)
177177

178178

179+
def test_multiindex_loc_str_tuple() -> None:
180+
s = pd.Series(
181+
[1, 2, 3, 4, 5, 6],
182+
index=pd.MultiIndex.from_product([["A", "B"], ["c", "d", "e"]]),
183+
dtype=int,
184+
)
185+
check(assert_type(s.loc[("A", "c")], int), np.int_)
186+
check(
187+
assert_type(s.loc[[("A", "c"), ("B", "d")]], "pd.Series[int]"),
188+
pd.Series,
189+
np.int_
190+
)
191+
192+
179193
def test_types_boolean_indexing() -> None:
180194
s = pd.Series([0, 1, 2])
181195
s[s > 1]

0 commit comments

Comments
 (0)