@@ -6,6 +6,7 @@ from typing import (
66)
77
88import numpy as np
9+ import numpy .typing as npt
910import pandas as pd
1011from pandas import Index
1112from pandas .core .indexes .accessors import PeriodIndexFieldOps
@@ -14,27 +15,27 @@ from pandas.core.indexes.timedeltas import TimedeltaIndex
1415from typing_extensions import Self
1516
1617from pandas ._libs .tslibs import (
17- BaseOffset ,
1818 NaTType ,
1919 Period ,
2020)
2121from pandas ._libs .tslibs .period import _PeriodAddSub
22+ from pandas ._typing import (
23+ AxesData ,
24+ Dtype ,
25+ Frequency ,
26+ )
2227
2328class PeriodIndex (DatetimeIndexOpsMixin [pd .Period , np .object_ ], PeriodIndexFieldOps ):
2429 def __new__ (
2530 cls ,
26- data = ...,
27- ordinal = ...,
28- freq = ...,
29- tz = ...,
30- dtype = ...,
31- copy : bool = ...,
32- name : Hashable = ...,
33- ** fields ,
31+ data : AxesData | None = None ,
32+ freq : Frequency | None = None ,
33+ dtype : Dtype | None = None ,
34+ copy : bool = False ,
35+ name : Hashable | None = None ,
3436 ): ...
3537 @property
36- def values (self ): ...
37- def __contains__ (self , key ) -> bool : ...
38+ def values (self ) -> npt .NDArray [np .object_ ]: ...
3839 @overload
3940 def __sub__ (self , other : Period ) -> Index : ...
4041 @overload
@@ -53,8 +54,6 @@ class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexField
5354 def __rsub__ ( # pyright: ignore[reportIncompatibleMethodOverride]
5455 self , other : NaTType
5556 ) -> NaTType : ...
56- @final
57- def __array_wrap__ (self , result , context = ...): ...
5857 def asof_locs (self , where , mask ): ...
5958 def searchsorted (self , value , side : str = ..., sorter = ...): ...
6059 @property
@@ -87,6 +86,6 @@ def period_range(
8786 str | datetime .datetime | datetime .date | pd .Timestamp | pd .Period | None
8887 ) = None ,
8988 periods : int | None = None ,
90- freq : str | BaseOffset | None = None ,
89+ freq : Frequency | None = None ,
9190 name : Hashable | None = None ,
9291) -> PeriodIndex : ...
0 commit comments