@@ -300,7 +300,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
300
300
copy : bool = ...,
301
301
) -> Series [float ]: ...
302
302
@overload
303
- def __new__ ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
303
+ def __new__ (
304
304
cls ,
305
305
data : Sequence [Never ],
306
306
index : AxesData | None = ...,
@@ -360,7 +360,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
360
360
dtype : PeriodDtype = ...,
361
361
name : Hashable = ...,
362
362
copy : bool = ...,
363
- ) -> PeriodSeries : ...
363
+ ) -> Series [ Period ] : ...
364
364
@overload
365
365
def __new__ (
366
366
cls ,
@@ -845,6 +845,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
845
845
@overload
846
846
def diff (self : Series [Timedelta ], periods : int = ...) -> Series [Timedelta ]: ... # type: ignore[overload-overlap]
847
847
@overload
848
+ def diff (self : Series [Period ], periods : int = ...) -> OffsetSeries : ... # type: ignore[overload-overlap]
849
+ @overload
848
850
def diff (self , periods : int = ...) -> Series [float ]: ...
849
851
def autocorr (self , lag : int = 1 ) -> float : ...
850
852
@overload
@@ -1688,7 +1690,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1688
1690
),
1689
1691
) -> Series [Timedelta ]: ...
1690
1692
@overload
1691
- def __add__ (self : Series [Timedelta ], other : Period ) -> PeriodSeries : ...
1693
+ def __add__ (self : Series [Timedelta ], other : Period ) -> Series [ Period ] : ...
1692
1694
@overload
1693
1695
def __add__ (self : Series [bool ], other : bool | Sequence [bool ]) -> Series [bool ]: ...
1694
1696
@overload
@@ -1815,7 +1817,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1815
1817
level : Level | None = None ,
1816
1818
fill_value : float | None = None ,
1817
1819
axis : int = 0 ,
1818
- ) -> PeriodSeries : ...
1820
+ ) -> Series [ Period ] : ...
1819
1821
@overload
1820
1822
def add (
1821
1823
self : Series [bool ],
@@ -1950,7 +1952,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1950
1952
),
1951
1953
) -> Series [Timedelta ]: ...
1952
1954
@overload
1953
- def __radd__ (self : Series [Timedelta ], other : Period ) -> PeriodSeries : ...
1955
+ def __radd__ (self : Series [Timedelta ], other : Period ) -> Series [ Period ] : ...
1954
1956
@overload
1955
1957
def __radd__ (self : Series [bool ], other : bool | Sequence [bool ]) -> Series [bool ]: ...
1956
1958
@overload
@@ -2077,7 +2079,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2077
2079
level : Level | None = None ,
2078
2080
fill_value : float | None = None ,
2079
2081
axis : int = 0 ,
2080
- ) -> PeriodSeries : ...
2082
+ ) -> Series [ Period ] : ...
2081
2083
@overload
2082
2084
def radd (
2083
2085
self : Series [bool ],
@@ -3194,6 +3196,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
3194
3196
),
3195
3197
) -> Series [Timedelta ]: ...
3196
3198
@overload
3199
+ def __sub__ (
3200
+ self : Series [Period ], other : Series [Period ] | Period
3201
+ ) -> Series [BaseOffset ]: ...
3202
+ @overload
3197
3203
def sub (
3198
3204
self : Series [Never ],
3199
3205
other : complex | NumListLike | Index [T_COMPLEX ] | Series [T_COMPLEX ],
@@ -3365,6 +3371,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
3365
3371
axis : int = 0 ,
3366
3372
) -> Series [Timedelta ]: ...
3367
3373
@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
3368
3382
def __rsub__ (
3369
3383
self : Series [Never ],
3370
3384
other : (
@@ -3495,6 +3509,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
3495
3509
),
3496
3510
) -> Series [Timedelta ]: ...
3497
3511
@overload
3512
+ def __rsub__ (
3513
+ self : Series [Period ], other : Series [Period ] | Period
3514
+ ) -> Series [BaseOffset ]: ...
3515
+ @overload
3498
3516
def rsub (
3499
3517
self : Series [Never ],
3500
3518
other : (
@@ -3675,6 +3693,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
3675
3693
axis : int = 0 ,
3676
3694
) -> Series [Timedelta ]: ...
3677
3695
@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
3678
3704
def __truediv__ ( # type: ignore[overload-overlap]
3679
3705
self : Series [Never ], other : complex | NumListLike | Index | Series
3680
3706
) -> Series : ...
@@ -4613,6 +4639,22 @@ class Series(IndexOpsMixin[S1], NDFrame):
4613
4639
** kwargs ,
4614
4640
) -> np_1darray [GenericT ]: ...
4615
4641
@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
4616
4658
def to_numpy (
4617
4659
self : Series [Interval ],
4618
4660
dtype : type [np .object_ ] | None = None ,
@@ -4722,14 +4764,9 @@ class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
4722
4764
** kwargs ,
4723
4765
) -> np_1darray : ...
4724
4766
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
-
4730
4767
class OffsetSeries (_SeriesSubclassBase [BaseOffset , np .object_ ]):
4731
4768
@overload # type: ignore[override]
4732
- def __radd__ (self , other : Period ) -> PeriodSeries : ...
4769
+ def __radd__ (self , other : Period ) -> Series [ Period ] : ...
4733
4770
@overload
4734
4771
def __radd__ ( # pyright: ignore[reportIncompatibleMethodOverride]
4735
4772
self , other : BaseOffset
0 commit comments