@@ -1609,6 +1609,16 @@ class Series(IndexOpsMixin[S1], NDFrame):
1609
1609
@overload
1610
1610
def __add__ (self , other : S1 | Self ) -> Self : ...
1611
1611
@overload
1612
+ def __add__ (
1613
+ self : Series [int ] | Series [float ],
1614
+ other : float | Series [float ],
1615
+ ) -> Series [float ]: ...
1616
+ @overload
1617
+ def __add__ (
1618
+ self : Series [float ],
1619
+ other : int | Series [int ],
1620
+ ) -> Series [float ]: ...
1621
+ @overload
1612
1622
def __add__ (
1613
1623
self ,
1614
1624
other : complex ,
@@ -1629,6 +1639,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
1629
1639
) -> Series [int ]: ...
1630
1640
# def __array__(self, dtype: Optional[_bool] = ...) -> _np_ndarray
1631
1641
def __eq__ (self , other : object ) -> Series [_bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1642
+ @overload
1643
+ def __floordiv__ (self : Series [float ], other : Series [float ] | Series [int ] | float ) -> Series [float ]: ... # type: ignore[overload-overlap]
1644
+ @overload
1632
1645
def __floordiv__ (self , other : num | _ListLike | Series [S1 ]) -> Series [int ]: ...
1633
1646
def __ge__ ( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1634
1647
self , other : S1 | _ListLike | Series [S1 ] | datetime | timedelta | date
@@ -1657,11 +1670,29 @@ class Series(IndexOpsMixin[S1], NDFrame):
1657
1670
@overload
1658
1671
def __mul__ (self : Series [int ], other : Series [float ] | float ) -> Series [float ]: ...
1659
1672
@overload
1673
+ def __mul__ (self : Series [float ], other : Series [int ] | int ) -> Series [float ]: ...
1674
+ @overload
1660
1675
def __mul__ (self : Series [Any ], other : Series [Any ]) -> Series : ...
1661
1676
@overload
1662
1677
def __mul__ (self , other : num | _ListLike | Series ) -> Series : ...
1678
+ @overload
1679
+ def __mod__ ( # pyright: ignore[reportOverlappingOverload]
1680
+ self : Series [int ], other : int | Series [int ]
1681
+ ) -> Series [int ]: ...
1682
+ @overload
1683
+ def __mod__ (self : Series [int ], other : float | Series [float ]) -> Series [float ]: ...
1684
+ @overload
1685
+ def __mod__ (
1686
+ self : Series [float ], other : float | Series [int ] | Series [float ]
1687
+ ) -> Series [float ]: ...
1688
+ @overload
1663
1689
def __mod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1664
1690
def __ne__ (self , other : object ) -> Series [_bool ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1691
+ @overload
1692
+ def __pow__ (self : Series [int ], other : Series [int ] | int ) -> Series [int ]: ...
1693
+ @overload
1694
+ def __pow__ (self , other : Series [float ] | float ) -> Series [float ]: ...
1695
+ @overload
1665
1696
def __pow__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1666
1697
# ignore needed for mypy as we want different results based on the arguments
1667
1698
@overload # type: ignore[override]
@@ -1686,7 +1717,12 @@ class Series(IndexOpsMixin[S1], NDFrame):
1686
1717
self , other : int | np_ndarray_anyint | Series [int ]
1687
1718
) -> Series [int ]: ...
1688
1719
def __rdivmod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
1689
- def __rfloordiv__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1720
+ @overload
1721
+ def __rfloordiv__ (self : Series [float ], other : float | Series [int ] | Series [float ]) -> Series [float ]: ... # type: ignore[misc]
1722
+ @overload
1723
+ def __rfloordiv__ (
1724
+ self , other : num | _ListLike | Series [float ]
1725
+ ) -> Series [float ]: ...
1690
1726
def __rmod__ (self , other : num | _ListLike | Series [S1 ]) -> Series [S1 ]: ...
1691
1727
@overload
1692
1728
def __rmul__ (
@@ -1731,25 +1767,35 @@ class Series(IndexOpsMixin[S1], NDFrame):
1731
1767
self , other : Timestamp | datetime | TimestampSeries
1732
1768
) -> TimedeltaSeries : ...
1733
1769
@overload
1734
- def __sub__ (
1770
+ def __sub__ (self , other : S1 | Self ) -> Self : ...
1771
+ @overload
1772
+ def __sub__ ( # pyright: ignore[reportOverlappingOverload]
1735
1773
self : Series [int ],
1736
1774
other : int | Series [int ],
1737
1775
) -> Series [int ]: ...
1738
1776
@overload
1777
+ def __sub__ (
1778
+ self : Series [int ],
1779
+ other : float | Series [float ],
1780
+ ) -> Series [float ]: ...
1781
+ @overload
1782
+ def __sub__ (
1783
+ self : Series [float ],
1784
+ other : int | Series [int ],
1785
+ ) -> Series [float ]: ...
1786
+ @overload
1739
1787
def __sub__ (
1740
1788
self ,
1741
1789
other : complex ,
1742
1790
) -> Series [complex ]: ...
1743
1791
@overload
1744
- def __sub__ (self , other : S1 | Self ) -> Self : ...
1745
- @overload
1746
1792
def __sub__ (self , other : num | _ListLike | Series ) -> Series : ...
1747
1793
@overload
1748
1794
def __truediv__ (self : Series [int ], other : Series [int ] | int ) -> Series [float ]: ...
1749
1795
@overload
1750
- def __truediv__ (
1751
- self , other : num | _ListLike | Series [ S1 ] | Path
1752
- ) -> Series | Self : ...
1796
+ def __truediv__ (self , other : Path ) -> Series : ...
1797
+ @ overload
1798
+ def __truediv__ ( self , other : num | _ListLike | Series [ S1 ] ) -> Series [ float ] : ...
1753
1799
# ignore needed for mypy as we want different results based on the arguments
1754
1800
@overload # type: ignore[override]
1755
1801
def __xor__ ( # pyright: ignore[reportOverlappingOverload]
@@ -1773,7 +1819,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1773
1819
def iloc (self ) -> _iLocIndexerSeries [S1 ]: ...
1774
1820
@property
1775
1821
def loc (self ) -> _LocIndexerSeries [S1 ]: ...
1776
- # Methods
1822
+ # Met @overload
1777
1823
@overload
1778
1824
def add (
1779
1825
self : Series [int ],
@@ -1783,6 +1829,22 @@ class Series(IndexOpsMixin[S1], NDFrame):
1783
1829
axis : int = ...,
1784
1830
) -> Series [int ]: ...
1785
1831
@overload
1832
+ def add ( # pyright: ignore[reportOverlappingOverload]
1833
+ self ,
1834
+ other : float | Series [float ],
1835
+ level : Level | None = ...,
1836
+ fill_value : float | None = ...,
1837
+ axis : int = ...,
1838
+ ) -> Series [float ]: ...
1839
+ @overload
1840
+ def add (
1841
+ self : Series [float ],
1842
+ other : int | Series [int ],
1843
+ level : Level | None = ...,
1844
+ fill_value : float | None = ...,
1845
+ axis : int = ...,
1846
+ ) -> Series [float ]: ...
1847
+ @overload
1786
1848
def add (
1787
1849
self ,
1788
1850
other : complex ,
@@ -1798,6 +1860,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
1798
1860
fill_value : float | None = ...,
1799
1861
axis : int = ...,
1800
1862
) -> Series [S1 ]: ...
1863
+ @overload
1864
+ def add (
1865
+ self ,
1866
+ other : S1 | Self ,
1867
+ level : Level | None = ...,
1868
+ fill_value : float | None = ...,
1869
+ axis : int = ...,
1870
+ ) -> Series : ...
1801
1871
def all (
1802
1872
self ,
1803
1873
axis : AxisIndex = ...,
@@ -1861,13 +1931,30 @@ class Series(IndexOpsMixin[S1], NDFrame):
1861
1931
min_periods : int = ...,
1862
1932
method : CalculationMethod = ...,
1863
1933
) -> Expanding [Series ]: ...
1934
+ @overload
1935
+ def floordiv ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
1936
+ self : Series [int ],
1937
+ other : Series [int ] | int ,
1938
+ level : Level | None = ...,
1939
+ fill_value : float | None = ...,
1940
+ axis : AxisIndex | None = ...,
1941
+ ) -> Series [int ]: ...
1942
+ @overload
1943
+ def floordiv (
1944
+ self : Series [int ] | Series [float ],
1945
+ other : num | _ListLike | Series [S1 ],
1946
+ level : Level | None = ...,
1947
+ fill_value : float | None = ...,
1948
+ axis : AxisIndex | None = ...,
1949
+ ) -> Series [float ]: ...
1950
+ @overload
1864
1951
def floordiv (
1865
1952
self ,
1866
1953
other : num | _ListLike | Series [S1 ],
1867
1954
level : Level | None = ...,
1868
1955
fill_value : float | None = ...,
1869
1956
axis : AxisIndex | None = ...,
1870
- ) -> Series [int ]: ...
1957
+ ) -> Series [S1 ]: ...
1871
1958
def ge (
1872
1959
self ,
1873
1960
other : Scalar | Series [S1 ],
@@ -1945,6 +2032,31 @@ class Series(IndexOpsMixin[S1], NDFrame):
1945
2032
numeric_only : _bool = ...,
1946
2033
** kwargs ,
1947
2034
) -> S1 : ...
2035
+ @overload
2036
+ def mod ( # pyright: ignore[reportOverlappingOverload]
2037
+ self : Series [int ],
2038
+ other : Series [int ] | int ,
2039
+ level : Level | None = ...,
2040
+ fill_value : float | None = ...,
2041
+ axis : AxisIndex | None = ...,
2042
+ ) -> Series [int ]: ...
2043
+ @overload
2044
+ def mod (
2045
+ self : Series [int ],
2046
+ other : Series [float ] | float ,
2047
+ level : Level | None = ...,
2048
+ fill_value : float | None = ...,
2049
+ axis : AxisIndex | None = ...,
2050
+ ) -> Series [float ]: ...
2051
+ @overload
2052
+ def mod (
2053
+ self : Series [float ],
2054
+ other : Series [int ] | Series [float ] | float ,
2055
+ level : Level | None = ...,
2056
+ fill_value : float | None = ...,
2057
+ axis : AxisIndex | None = ...,
2058
+ ) -> Series [float ]: ...
2059
+ @overload
1948
2060
def mod (
1949
2061
self ,
1950
2062
other : num | _ListLike | Series [S1 ],
@@ -1953,17 +2065,25 @@ class Series(IndexOpsMixin[S1], NDFrame):
1953
2065
axis : AxisIndex | None = ...,
1954
2066
) -> Series [S1 ]: ...
1955
2067
@overload
1956
- def mul (
2068
+ def mul ( # pyright: ignore[reportOverlappingOverload]
1957
2069
self : Series [int ],
1958
2070
other : Series [int ] | int ,
1959
2071
level : Level | None = ...,
1960
2072
fill_value : int | None = ...,
1961
2073
axis : AxisIndex | None = ...,
1962
2074
) -> Series [int ]: ...
1963
2075
@overload
2076
+ def mul (
2077
+ self : Series [float ],
2078
+ other : Series [int ] | Series [float ] | int ,
2079
+ level : Level | None = ...,
2080
+ fill_value : float | None = ...,
2081
+ axis : AxisIndex | None = ...,
2082
+ ) -> Series [float ]: ...
2083
+ @overload
1964
2084
def mul (
1965
2085
self : Series [int ],
1966
- other : Series [float ],
2086
+ other : Series [float ] | float ,
1967
2087
level : Level | None = ...,
1968
2088
fill_value : float | None = ...,
1969
2089
axis : AxisIndex | None = ...,
@@ -2002,7 +2122,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2002
2122
@overload
2003
2123
def pow (
2004
2124
self : Series [int ],
2005
- other : float ,
2125
+ other : float | Series [ float ] ,
2006
2126
level : Level | None = ...,
2007
2127
fill_value : float | None = ...,
2008
2128
axis : AxisIndex | None = ...,
@@ -2161,7 +2281,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2161
2281
@overload
2162
2282
def sub (
2163
2283
self : Series [int ],
2164
- other : float ,
2284
+ other : float | Series [ float ] ,
2165
2285
level : Level | None = ...,
2166
2286
fill_value : float | None = ...,
2167
2287
axis : AxisIndex | None = ...,
0 commit comments