forked from pandas-dev/pandas-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperiod.pyi
96 lines (92 loc) · 2.75 KB
/
period.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from collections.abc import Hashable
import datetime
from typing import overload
import numpy as np
import pandas as pd
from pandas import Index
from pandas.core.indexes.accessors import PeriodIndexFieldOps
from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin
from pandas.core.indexes.timedeltas import TimedeltaIndex
from typing_extensions import Self
from pandas._libs.tslibs import (
BaseOffset,
NaTType,
Period,
)
from pandas._libs.tslibs.period import _PeriodAddSub
class PeriodIndex(DatetimeIndexOpsMixin[pd.Period], PeriodIndexFieldOps):
def __new__(
cls,
data=...,
ordinal=...,
freq=...,
tz=...,
dtype=...,
copy: bool = ...,
name=...,
**fields,
): ...
@property
def values(self): ...
def __contains__(self, key) -> bool: ...
@overload
def __sub__(self, other: Period) -> Index: ...
@overload
def __sub__(self, other: Self) -> Index: ...
@overload
def __sub__(self, other: _PeriodAddSub) -> Self: ...
@overload
def __sub__(self, other: NaTType) -> NaTType: ...
@overload
def __sub__(self, other: TimedeltaIndex | pd.Timedelta) -> Self: ...
@overload # type: ignore[override]
def __rsub__(self, other: Period) -> Index: ...
@overload
def __rsub__(self, other: Self) -> Index: ...
@overload
def __rsub__(self, other: NaTType) -> NaTType: ...
def __array__(self, dtype=...) -> np.ndarray: ...
def __array_wrap__(self, result, context=...): ...
def asof_locs(self, where, mask): ...
def astype(self, dtype, copy: bool = ..., how: str = ...): ...
def searchsorted(self, value, side: str = ..., sorter=...): ...
@property
def is_full(self) -> bool: ...
@property
def inferred_type(self) -> str: ...
def get_value(self, series, key): ...
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
def get_indexer_non_unique(self, target): ...
def get_loc(self, key, tolerance=...): ...
def insert(self, loc, item): ...
def join(
self,
other,
*,
how: str = ...,
level=...,
return_indexers: bool = ...,
sort: bool = ...,
): ...
def intersection(self, other, sort: bool = ...): ...
def difference(self, other, sort=...): ...
def memory_usage(self, deep: bool = ...): ...
@property
def freqstr(self) -> str: ...
def period_range(
start: str
| datetime.datetime
| datetime.date
| pd.Timestamp
| pd.Period
| None = ...,
end: str
| datetime.datetime
| datetime.date
| pd.Timestamp
| pd.Period
| None = ...,
periods: int | None = ...,
freq: str | BaseOffset | None = ...,
name: Hashable | None = ...,
) -> PeriodIndex: ...