Skip to content

Commit a6653dc

Browse files
GH1419 PR Feedback
1 parent 86c94eb commit a6653dc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/indexes/test_indexes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,17 @@ def test_to_series() -> None:
16131613

16141614
def test_index_where() -> None:
16151615
"""Test Index.where with multiple types of other GH1419."""
1616+
idx = pd.Index(range(48))
1617+
mask = np.ones(48, dtype=bool)
1618+
val_idx = idx.where(mask, idx)
1619+
check(assert_type(val_idx, "pd.Index[int]"), pd.Index, np.integer)
1620+
1621+
val_sr = idx.where(mask, (idx).to_series())
1622+
check(assert_type(val_sr, "pd.Index[int]"), pd.Index, np.integer)
1623+
1624+
1625+
def test_datetimeindex_where() -> None:
1626+
"""Test DatetimeIndex.where with multiple types of other GH1419."""
16161627
datetime_index = pd.DatetimeIndex(
16171628
pd.date_range(start="2025-01-01", freq="h", periods=48)
16181629
)

0 commit comments

Comments
 (0)