@@ -368,6 +368,15 @@ class Series(IndexOpsMixin[S1], NDFrame):
368
368
copy : bool = ...,
369
369
) -> Series [Period ]: ...
370
370
@overload
371
+ def __new__ (
372
+ cls ,
373
+ data : Sequence [BaseOffset ],
374
+ index : AxesData | None = ...,
375
+ dtype : PeriodDtype = ...,
376
+ name : Hashable = ...,
377
+ copy : bool = ...,
378
+ ) -> Series [BaseOffset ]: ...
379
+ @overload
371
380
def __new__ (
372
381
cls ,
373
382
data : (
@@ -848,8 +857,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
848
857
self : Series [BooleanDtype ], periods : int = ...
849
858
) -> Series [BooleanDtype ]: ...
850
859
@overload
851
- def diff (self : Series [Period ], periods : int = ...) -> OffsetSeries : ...
852
- @overload
853
860
def diff (self : Series [Interval ], periods : int = ...) -> Never : ...
854
861
@overload
855
862
def diff (
@@ -1065,7 +1072,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1065
1072
convertDType : _bool = ...,
1066
1073
args : tuple = ...,
1067
1074
** kwargs : Any ,
1068
- ) -> OffsetSeries : ...
1075
+ ) -> Series [ BaseOffset ] : ...
1069
1076
@overload
1070
1077
def apply (
1071
1078
self ,
@@ -2018,6 +2025,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
2018
2025
other : _str | Sequence [_str ] | np_ndarray_str | Index [_str ] | Series [_str ],
2019
2026
) -> Series [_str ]: ...
2020
2027
@overload
2028
+ def __radd__ (self : Series [BaseOffset ], other : Period ) -> Series [Period ]: ...
2029
+ @overload
2030
+ def __radd__ (self : Series [BaseOffset ], other : BaseOffset ) -> Series [BaseOffset ]: ...
2031
+ @overload
2021
2032
def radd (
2022
2033
self : Series [Never ],
2023
2034
other : complex | _ListLike | Index | Series ,
@@ -4670,6 +4681,22 @@ class Series(IndexOpsMixin[S1], NDFrame):
4670
4681
** kwargs ,
4671
4682
) -> np_1darray [np .int64 ]: ...
4672
4683
@overload
4684
+ def to_numpy (
4685
+ self : Series [BaseOffset ],
4686
+ dtype : None = None ,
4687
+ copy : bool = False ,
4688
+ na_value : Scalar = ...,
4689
+ ** kwargs ,
4690
+ ) -> np_1darray [np .object_ ]: ...
4691
+ @overload
4692
+ def to_numpy (
4693
+ self : Series [BaseOffset ],
4694
+ dtype : type [np .bytes_ ],
4695
+ copy : bool = False ,
4696
+ na_value : Scalar = ...,
4697
+ ** kwargs ,
4698
+ ) -> np_1darray [np .bytes_ ]: ...
4699
+ @overload
4673
4700
def to_numpy (
4674
4701
self : Series [Interval ],
4675
4702
dtype : type [np .object_ ] | None = None ,
@@ -4778,11 +4805,3 @@ class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
4778
4805
na_value : Scalar = ...,
4779
4806
** kwargs ,
4780
4807
) -> np_1darray : ...
4781
-
4782
- class OffsetSeries (_SeriesSubclassBase [BaseOffset , np .object_ ]):
4783
- @overload # type: ignore[override]
4784
- def __radd__ (self , other : Period ) -> Series [Period ]: ...
4785
- @overload
4786
- def __radd__ ( # pyright: ignore[reportIncompatibleMethodOverride]
4787
- self , other : BaseOffset
4788
- ) -> OffsetSeries : ...
0 commit comments