We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a1ff50 commit 8a0dcbdCopy full SHA for 8a0dcbd
pandas-stubs/core/arraylike.pyi
@@ -19,8 +19,6 @@ class OpsMixin:
19
def __rxor__(self, other: Any) -> Self: ...
20
# -------------------------------------------------------------
21
# Arithmetic Methods
22
- def __add__(self, other: Any) -> Self: ...
23
- def __radd__(self, other: Any) -> Self: ...
24
def __sub__(self, other: Any) -> Self: ...
25
def __rsub__(self, other: Any) -> Self: ...
26
def __mul__(self, other: Any) -> Self: ...
pandas-stubs/core/frame.pyi
@@ -1772,13 +1772,22 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1772
# methods
1773
@final
1774
def abs(self) -> Self: ...
1775
+ def __add__(self, other: Any) -> Self: ...
1776
def add(
1777
self,
1778
other: num | ListLike | DataFrame,
1779
axis: Axis | None = "columns",
1780
level: Level | None = None,
1781
fill_value: float | None = None,
1782
) -> Self: ...
1783
+ def __radd__(self, other: Any) -> Self: ...
1784
+ def radd(
1785
+ self,
1786
+ other,
1787
+ axis: Axis = "columns",
1788
+ level: Level | None = None,
1789
+ fill_value: float | None = None,
1790
+ ) -> Self: ...
1791
1792
def add_prefix(self, prefix: _str, axis: Axis | None = None) -> Self: ...
1793
@@ -2222,13 +2231,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2222
2231
min_count: int = 0,
2223
2232
**kwargs: Any,
2224
2233
) -> Series: ...
2225
- def radd(
2226
- self,
2227
- other,
2228
- axis: Axis = "columns",
2229
- level: Level | None = None,
2230
- fill_value: float | None = None,
- ) -> Self: ...
2234
2235
def rank(
2236
pandas-stubs/core/indexes/base.pyi
@@ -554,7 +554,7 @@ class Index(IndexOpsMixin[S1]):
554
def __add__(
555
self: Index[_str], other: _str | Sequence[_str] | np_ndarray_str | Index[_str]
556
) -> Index[_str]: ...
557
- @overload # type: ignore[override]
+ @overload
558
def __radd__(self: Index[Never], other: _str) -> Never: ...
559
@overload
560
def __radd__(self: Index[Never], other: complex | _ListLike | Index) -> Index: ...
pandas-stubs/core/series.pyi
@@ -1876,7 +1876,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1876
1877
axis: int = 0,
1878
) -> Series[_str]: ...
1879
1880
def __radd__(self: Series[Never], other: _str) -> Never: ...
1881
1882
def __radd__(
tests/indexes/test_indexes.py
@@ -262,12 +262,10 @@ def test_types_to_numpy() -> None:
262
def test_index_arithmetic() -> None:
263
# GH 287
264
idx = pd.Index([1, 2.2, 3], dtype=float)
265
- check(assert_type(idx + 3, "pd.Index[float]"), pd.Index, np.float64)
266
check(assert_type(idx - 3, "pd.Index[float]"), pd.Index, np.float64)
267
check(assert_type(idx * 3, "pd.Index[float]"), pd.Index, np.float64)
268
check(assert_type(idx / 3, "pd.Index[float]"), pd.Index, np.float64)
269
check(assert_type(idx // 3, "pd.Index[float]"), pd.Index, np.float64)
270
- check(assert_type(3 + idx, "pd.Index[float]"), pd.Index, np.float64)
271
check(assert_type(3 - idx, "pd.Index[float]"), pd.Index, np.float64)
272
check(assert_type(3 * idx, "pd.Index[float]"), pd.Index, np.float64)
273
check(assert_type(3 / idx, "pd.Index[float]"), pd.Index, np.float64)
0 commit comments