@@ -55,11 +55,9 @@ from pandas.core.api import (
55
55
Int32Dtype as Int32Dtype ,
56
56
Int64Dtype as Int64Dtype ,
57
57
)
58
- from pandas .core .arrays import TimedeltaArray
59
- from pandas .core .arrays .base import ExtensionArray
60
58
from pandas .core .arrays .categorical import CategoricalAccessor
61
59
from pandas .core .arrays .datetimes import DatetimeArray
62
- from pandas .core .arrays .interval import IntervalArray
60
+ from pandas .core .arrays .timedeltas import TimedeltaArray
63
61
from pandas .core .base import (
64
62
IndexOpsMixin ,
65
63
NumListLike ,
@@ -71,8 +69,8 @@ from pandas.core.groupby.generic import SeriesGroupBy
71
69
from pandas .core .groupby .groupby import BaseGroupBy
72
70
from pandas .core .indexers import BaseIndexer
73
71
from pandas .core .indexes .accessors import (
72
+ DtDescriptor ,
74
73
PeriodProperties ,
75
- _dtDescriptor ,
76
74
)
77
75
from pandas .core .indexes .category import CategoricalIndex
78
76
from pandas .core .indexes .datetimes import DatetimeIndex
@@ -392,7 +390,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
392
390
dtype : Literal ["Interval" ] = ...,
393
391
name : Hashable = ...,
394
392
copy : bool = ...,
395
- ) -> IntervalSeries [ _OrderableT ]: ...
393
+ ) -> Series [ Interval [ _OrderableT ] ]: ...
396
394
@overload
397
395
def __new__ ( # type: ignore[overload-overlap]
398
396
cls ,
@@ -479,8 +477,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
479
477
def name (self , value : Hashable | None ) -> None : ...
480
478
@property
481
479
def values (self ) -> ArrayLike : ...
482
- @property
483
- def array (self ) -> ExtensionArray : ...
484
480
def ravel (self , order : _str = ...) -> np .ndarray : ...
485
481
def __len__ (self ) -> int : ...
486
482
def view (self , dtype = ...) -> Series [S1 ]: ...
@@ -841,11 +837,10 @@ class Series(IndexOpsMixin[S1], NDFrame):
841
837
@overload
842
838
def diff (self : Series [complex ], periods : int = ...) -> Series [complex ]: ... # type: ignore[overload-overlap]
843
839
@overload
844
- def diff (self : Series [bytes ], periods : int = ...) -> Never : ...
845
- @overload
846
- def diff (self : Series [type ], periods : int = ...) -> Never : ...
847
- @overload
848
- def diff (self : Series [_str ], periods : int = ...) -> Never : ...
840
+ def diff (
841
+ self : Series [bytes ] | Series [type ] | Series [_str ] | Series [Interval ],
842
+ periods : int = ...,
843
+ ) -> Never : ...
849
844
@overload
850
845
def diff (self : Series [Timestamp ], periods : int = ...) -> Series [Timedelta ]: ... # type: ignore[overload-overlap]
851
846
@overload
@@ -1234,8 +1229,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1234
1229
Series [_str ],
1235
1230
Series ,
1236
1231
]: ...
1237
- @property
1238
- def dt (self ) -> _dtDescriptor [S1 ]: ...
1232
+ dt : ClassVar = DtDescriptor () # noqa
1239
1233
@property
1240
1234
def plot (self ) -> PlotAccessor : ...
1241
1235
sparse = ...
@@ -4211,9 +4205,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
4211
4205
def __xor__ (self , other : int | np_ndarray_anyint | Series [int ]) -> Series [int ]: ...
4212
4206
@final
4213
4207
def __invert__ (self ) -> Series [bool ]: ...
4214
- # properties
4215
- # @property
4216
- # def array(self) -> _npndarray
4217
4208
@property
4218
4209
def at (self ) -> _AtIndexer : ...
4219
4210
@property
@@ -4593,7 +4584,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
4593
4584
@overload # type: ignore[override]
4594
4585
def to_numpy ( # pyrefly: ignore[bad-override]
4595
4586
self : Series [Timestamp ],
4596
- dtype : None | type [np .datetime64 ] = None ,
4587
+ dtype : type [np .datetime64 ] | None = None ,
4597
4588
copy : bool = False ,
4598
4589
na_value : Scalar = ...,
4599
4590
** kwargs ,
@@ -4609,7 +4600,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
4609
4600
@overload
4610
4601
def to_numpy ( # pyrefly: ignore[bad-override]
4611
4602
self : Series [Timedelta ],
4612
- dtype : None | type [np .timedelta64 ] = None ,
4603
+ dtype : type [np .timedelta64 ] | None = None ,
4613
4604
copy : bool = False ,
4614
4605
na_value : Scalar = ...,
4615
4606
** kwargs ,
@@ -4623,6 +4614,22 @@ class Series(IndexOpsMixin[S1], NDFrame):
4623
4614
** kwargs ,
4624
4615
) -> np_1darray [GenericT ]: ...
4625
4616
@overload
4617
+ def to_numpy (
4618
+ self : Series [Interval ],
4619
+ dtype : type [np .object_ ] | None = None ,
4620
+ copy : bool = False ,
4621
+ na_value : Scalar = ...,
4622
+ ** kwargs ,
4623
+ ) -> np_1darray [np .object_ ]: ...
4624
+ @overload
4625
+ def to_numpy (
4626
+ self : Series [Interval ],
4627
+ dtype : np .dtype [GenericT ] | SupportsDType [GenericT ] | type [GenericT ],
4628
+ copy : bool = False ,
4629
+ na_value : Scalar = ...,
4630
+ ** kwargs ,
4631
+ ) -> np_1darray [GenericT ]: ...
4632
+ @overload
4626
4633
def to_numpy ( # pyright: ignore[reportIncompatibleMethodOverride]
4627
4634
self ,
4628
4635
dtype : DTypeLike | None = None ,
@@ -4718,7 +4725,7 @@ class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
4718
4725
4719
4726
class PeriodSeries (_SeriesSubclassBase [Period , np .object_ ]):
4720
4727
@property
4721
- def dt (self ) -> PeriodProperties : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
4728
+ def dt (self ) -> PeriodProperties : ... # type: ignore[override]
4722
4729
def __sub__ (self , other : PeriodSeries ) -> OffsetSeries : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
4723
4730
def diff (self , periods : int = ...) -> OffsetSeries : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
4724
4731
@@ -4729,10 +4736,3 @@ class OffsetSeries(_SeriesSubclassBase[BaseOffset, np.object_]):
4729
4736
def __radd__ ( # pyright: ignore[reportIncompatibleMethodOverride]
4730
4737
self , other : BaseOffset
4731
4738
) -> OffsetSeries : ...
4732
-
4733
- class IntervalSeries (
4734
- _SeriesSubclassBase [Interval [_OrderableT ], np .object_ ], Generic [_OrderableT ]
4735
- ):
4736
- @property
4737
- def array (self ) -> IntervalArray : ...
4738
- def diff (self , periods : int = ...) -> Never : ... # pyrefly: ignore
0 commit comments