1
1
from datetime import (
2
+ date as date_ ,
2
3
datetime ,
4
+ time as time_ ,
3
5
timedelta ,
4
6
tzinfo as _tzinfo ,
5
7
)
6
- import typing
8
+ from typing import (
9
+ Literal ,
10
+ NoReturn ,
11
+ TypeAlias ,
12
+ )
7
13
8
14
import numpy as np
9
15
10
16
from pandas ._libs .tslibs .period import Period
11
- from pandas ._typing import Self
17
+ from pandas ._typing import (
18
+ Frequency ,
19
+ Self ,
20
+ TimestampNonexistent ,
21
+ )
12
22
13
23
NaT : NaTType
14
24
iNaT : int
15
25
nat_strings : set [str ]
16
26
17
- _NaTComparisonTypes : typing . TypeAlias = (
27
+ _NaTComparisonTypes : TypeAlias = (
18
28
datetime | timedelta | Period | np .datetime64 | np .timedelta64
19
29
)
20
30
@@ -61,18 +71,38 @@ class NaTType:
61
71
def week (self ) -> float : ...
62
72
@property
63
73
def weekofyear (self ) -> float : ...
74
+ @property
75
+ def fold (self ) -> int : ...
64
76
def day_name (self ) -> float : ...
65
77
def month_name (self ) -> float : ...
66
78
def weekday (self ) -> float : ...
67
79
def isoweekday (self ) -> float : ...
80
+ def isoformat (self , sep : str = ..., timespec : str = ...) -> str : ...
81
+ def strftime (self , format : str ) -> NoReturn : ...
68
82
def total_seconds (self ) -> float : ...
69
83
def today (self , * args , ** kwargs ) -> NaTType : ...
70
84
def now (self , * args , ** kwargs ) -> NaTType : ...
71
85
def to_pydatetime (self ) -> NaTType : ...
72
86
def date (self ) -> NaTType : ...
73
- def round (self ) -> NaTType : ...
74
- def floor (self ) -> NaTType : ...
75
- def ceil (self ) -> NaTType : ...
87
+ def round (
88
+ self ,
89
+ freq : Frequency ,
90
+ ambiguous : bool | Literal ["raise" ] | NaTType = ...,
91
+ nonexistent : TimestampNonexistent = ...,
92
+ ) -> NaTType : ...
93
+ def floor (
94
+ self ,
95
+ freq : Frequency ,
96
+ ambiguous : bool | Literal ["raise" ] | NaTType = ...,
97
+ nonexistent : TimestampNonexistent = ...,
98
+ ) -> NaTType : ...
99
+ def ceil (
100
+ self ,
101
+ freq : Frequency ,
102
+ ambiguous : bool | Literal ["raise" ] | NaTType = ...,
103
+ nonexistent : TimestampNonexistent = ...,
104
+ ) -> NaTType : ...
105
+ def combine (cls , date : date_ , time : time_ ) -> NoReturn : ...
76
106
@property
77
107
def tzinfo (self ) -> None : ...
78
108
@property
@@ -81,8 +111,8 @@ class NaTType:
81
111
def tz_localize (
82
112
self ,
83
113
tz : _tzinfo | str | None ,
84
- ambiguous : str = ...,
85
- nonexistent : str = ...,
114
+ ambiguous : bool | Literal [ "raise" ] | NaTType = ...,
115
+ nonexistent : TimestampNonexistent = ...,
86
116
) -> NaTType : ...
87
117
def replace (
88
118
self ,
@@ -121,6 +151,8 @@ class NaTType:
121
151
@property
122
152
def days (self ) -> float : ...
123
153
@property
154
+ def seconds (self ) -> float : ...
155
+ @property
124
156
def microseconds (self ) -> float : ...
125
157
@property
126
158
def nanoseconds (self ) -> float : ...
0 commit comments