@@ -300,7 +300,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
300300 copy : bool = ...,
301301 ) -> Series [float ]: ...
302302 @overload
303- def __new__ ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
303+ def __new__ (
304304 cls ,
305305 data : Sequence [Never ],
306306 index : AxesData | None = ...,
@@ -360,7 +360,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
360360 dtype : PeriodDtype = ...,
361361 name : Hashable = ...,
362362 copy : bool = ...,
363- ) -> PeriodSeries : ...
363+ ) -> Series [ Period ] : ...
364364 @overload
365365 def __new__ (
366366 cls ,
@@ -845,6 +845,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
845845 @overload
846846 def diff (self : Series [Timedelta ], periods : int = ...) -> Series [Timedelta ]: ... # type: ignore[overload-overlap]
847847 @overload
848+ def diff (self : Series [Period ], periods : int = ...) -> OffsetSeries : ... # type: ignore[overload-overlap]
849+ @overload
848850 def diff (self , periods : int = ...) -> Series [float ]: ...
849851 def autocorr (self , lag : int = 1 ) -> float : ...
850852 @overload
@@ -1688,7 +1690,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
16881690 ),
16891691 ) -> Series [Timedelta ]: ...
16901692 @overload
1691- def __add__ (self : Series [Timedelta ], other : Period ) -> PeriodSeries : ...
1693+ def __add__ (self : Series [Timedelta ], other : Period ) -> Series [ Period ] : ...
16921694 @overload
16931695 def __add__ (self : Series [bool ], other : bool | Sequence [bool ]) -> Series [bool ]: ...
16941696 @overload
@@ -1815,7 +1817,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
18151817 level : Level | None = None ,
18161818 fill_value : float | None = None ,
18171819 axis : int = 0 ,
1818- ) -> PeriodSeries : ...
1820+ ) -> Series [ Period ] : ...
18191821 @overload
18201822 def add (
18211823 self : Series [bool ],
@@ -1950,7 +1952,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
19501952 ),
19511953 ) -> Series [Timedelta ]: ...
19521954 @overload
1953- def __radd__ (self : Series [Timedelta ], other : Period ) -> PeriodSeries : ...
1955+ def __radd__ (self : Series [Timedelta ], other : Period ) -> Series [ Period ] : ...
19541956 @overload
19551957 def __radd__ (self : Series [bool ], other : bool | Sequence [bool ]) -> Series [bool ]: ...
19561958 @overload
@@ -2077,7 +2079,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
20772079 level : Level | None = None ,
20782080 fill_value : float | None = None ,
20792081 axis : int = 0 ,
2080- ) -> PeriodSeries : ...
2082+ ) -> Series [ Period ] : ...
20812083 @overload
20822084 def radd (
20832085 self : Series [bool ],
@@ -3194,6 +3196,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
31943196 ),
31953197 ) -> Series [Timedelta ]: ...
31963198 @overload
3199+ def __sub__ (
3200+ self : Series [Period ], other : Series [Period ] | Period
3201+ ) -> Series [BaseOffset ]: ...
3202+ @overload
31973203 def sub (
31983204 self : Series [Never ],
31993205 other : complex | NumListLike | Index [T_COMPLEX ] | Series [T_COMPLEX ],
@@ -3365,6 +3371,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
33653371 axis : int = 0 ,
33663372 ) -> Series [Timedelta ]: ...
33673373 @overload
3374+ def sub (
3375+ self : Series [Period ],
3376+ other : Period | Sequence [Period ] | PeriodIndex | Series [Period ],
3377+ level : Level | None = None ,
3378+ fill_value : float | None = None ,
3379+ axis : int = 0 ,
3380+ ) -> Series [BaseOffset ]: ...
3381+ @overload
33683382 def __rsub__ (
33693383 self : Series [Never ],
33703384 other : (
@@ -3495,6 +3509,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
34953509 ),
34963510 ) -> Series [Timedelta ]: ...
34973511 @overload
3512+ def __rsub__ (
3513+ self : Series [Period ], other : Series [Period ] | Period
3514+ ) -> Series [BaseOffset ]: ...
3515+ @overload
34983516 def rsub (
34993517 self : Series [Never ],
35003518 other : (
@@ -3675,6 +3693,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
36753693 axis : int = 0 ,
36763694 ) -> Series [Timedelta ]: ...
36773695 @overload
3696+ def rsub (
3697+ self : Series [Period ],
3698+ other : Period | Sequence [Period ] | PeriodIndex | Series [Period ],
3699+ level : Level | None = None ,
3700+ fill_value : float | None = None ,
3701+ axis : int = 0 ,
3702+ ) -> Series [BaseOffset ]: ...
3703+ @overload
36783704 def __truediv__ ( # type: ignore[overload-overlap]
36793705 self : Series [Never ], other : complex | NumListLike | Index | Series
36803706 ) -> Series : ...
@@ -4613,6 +4639,22 @@ class Series(IndexOpsMixin[S1], NDFrame):
46134639 ** kwargs ,
46144640 ) -> np_1darray [GenericT ]: ...
46154641 @overload
4642+ def to_numpy (
4643+ self : Series [Period ],
4644+ dtype : None = None ,
4645+ copy : bool = False ,
4646+ na_value : Scalar = ...,
4647+ ** kwargs ,
4648+ ) -> np_1darray [np .object_ ]: ...
4649+ @overload
4650+ def to_numpy (
4651+ self : Series [Period ],
4652+ dtype : type [np .int64 ],
4653+ copy : bool = False ,
4654+ na_value : Scalar = ...,
4655+ ** kwargs ,
4656+ ) -> np_1darray [np .int64 ]: ...
4657+ @overload
46164658 def to_numpy (
46174659 self : Series [Interval ],
46184660 dtype : type [np .object_ ] | None = None ,
@@ -4722,14 +4764,9 @@ class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
47224764 ** kwargs ,
47234765 ) -> np_1darray : ...
47244766
4725- class PeriodSeries (_SeriesSubclassBase [Period , np .object_ ]):
4726- dt : ClassVar = DtDescriptor () # noqa
4727- def __sub__ (self , other : PeriodSeries ) -> OffsetSeries : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
4728- def diff (self , periods : int = ...) -> OffsetSeries : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
4729-
47304767class OffsetSeries (_SeriesSubclassBase [BaseOffset , np .object_ ]):
47314768 @overload # type: ignore[override]
4732- def __radd__ (self , other : Period ) -> PeriodSeries : ...
4769+ def __radd__ (self , other : Period ) -> Series [ Period ] : ...
47334770 @overload
47344771 def __radd__ ( # pyright: ignore[reportIncompatibleMethodOverride]
47354772 self , other : BaseOffset
0 commit comments