@@ -362,6 +362,15 @@ class Series(IndexOpsMixin[S1], NDFrame):
362
362
copy : bool = ...,
363
363
) -> Series [Period ]: ...
364
364
@overload
365
+ def __new__ (
366
+ cls ,
367
+ data : Sequence [BaseOffset ],
368
+ index : AxesData | None = ...,
369
+ dtype : PeriodDtype = ...,
370
+ name : Hashable = ...,
371
+ copy : bool = ...,
372
+ ) -> Series [BaseOffset ]: ...
373
+ @overload
365
374
def __new__ (
366
375
cls ,
367
376
data : (
@@ -848,7 +857,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
848
857
@overload
849
858
def diff (self : Series [Timedelta ], periods : int = ...) -> Series [Timedelta ]: ... # type: ignore[overload-overlap]
850
859
@overload
851
- def diff (self : Series [Period ], periods : int = ...) -> OffsetSeries : ... # type: ignore[overload-overlap]
860
+ def diff (self : Series [Period ], periods : int = ...) -> Series [ BaseOffset ] : ... # type: ignore[overload-overlap]
852
861
@overload
853
862
def diff (self , periods : int = ...) -> Series [float ]: ...
854
863
def autocorr (self , lag : int = 1 ) -> float : ...
@@ -1061,7 +1070,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1061
1070
convertDType : _bool = ...,
1062
1071
args : tuple = ...,
1063
1072
** kwargs : Any ,
1064
- ) -> OffsetSeries : ...
1073
+ ) -> Series [ BaseOffset ] : ...
1065
1074
@overload
1066
1075
def apply (
1067
1076
self ,
@@ -2014,6 +2023,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
2014
2023
other : _str | Sequence [_str ] | np_ndarray_str | Index [_str ] | Series [_str ],
2015
2024
) -> Series [_str ]: ...
2016
2025
@overload
2026
+ def __radd__ (self : Series [BaseOffset ], other : Period ) -> Series [Period ]: ...
2027
+ @overload
2028
+ def __radd__ (self : Series [BaseOffset ], other : BaseOffset ) -> Series [BaseOffset ]: ...
2029
+ @overload
2017
2030
def radd (
2018
2031
self : Series [Never ],
2019
2032
other : complex | _ListLike | Index | Series ,
@@ -4669,6 +4682,22 @@ class Series(IndexOpsMixin[S1], NDFrame):
4669
4682
** kwargs ,
4670
4683
) -> np_1darray [np .int64 ]: ...
4671
4684
@overload
4685
+ def to_numpy (
4686
+ self : Series [BaseOffset ],
4687
+ dtype : None = None ,
4688
+ copy : bool = False ,
4689
+ na_value : Scalar = ...,
4690
+ ** kwargs ,
4691
+ ) -> np_1darray [np .object_ ]: ...
4692
+ @overload
4693
+ def to_numpy (
4694
+ self : Series [BaseOffset ],
4695
+ dtype : type [np .bytes_ ],
4696
+ copy : bool = False ,
4697
+ na_value : Scalar = ...,
4698
+ ** kwargs ,
4699
+ ) -> np_1darray [np .bytes_ ]: ...
4700
+ @overload
4672
4701
def to_numpy ( # pyright: ignore[reportIncompatibleMethodOverride]
4673
4702
self ,
4674
4703
dtype : DTypeLike | None = None ,
@@ -4762,14 +4791,6 @@ class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
4762
4791
** kwargs ,
4763
4792
) -> np_1darray : ...
4764
4793
4765
- class OffsetSeries (_SeriesSubclassBase [BaseOffset , np .object_ ]):
4766
- @overload # type: ignore[override]
4767
- def __radd__ (self , other : Period ) -> Series [Period ]: ...
4768
- @overload
4769
- def __radd__ ( # pyright: ignore[reportIncompatibleMethodOverride]
4770
- self , other : BaseOffset
4771
- ) -> OffsetSeries : ...
4772
-
4773
4794
class IntervalSeries (
4774
4795
_SeriesSubclassBase [Interval [_OrderableT ], np .object_ ], Generic [_OrderableT ]
4775
4796
):
0 commit comments