Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
@overload
def __add__(self, other: S1 | Self) -> Self: ...
@overload
def __add__(self, other: complex) -> Series[complex]: ...
@overload
def __add__(
self,
other: num | _str | timedelta | Timedelta | _ListLike | Series | np.timedelta64,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3538,6 +3538,12 @@ def test_series_reindex() -> None:
check(assert_type(s.reindex([2, 1, 0]), "pd.Series[int]"), pd.Series, np.integer)


def test_series_add_complex() -> None:
c = 1 + 1j
s = pd.Series([1.0, 2.0, 3.0])
check(assert_type(s + c, "pd.Series[complex]"), pd.Series)


def test_series_reindex_like() -> None:
s = pd.Series([1, 2, 3], index=[0, 1, 2])
other = pd.Series([1, 2], index=[1, 0])
Expand Down