Skip to content

Commit cd36acb

Browse files
committed
fix pandas.Timestamp.fold GL08
1 parent 220c18d commit cd36acb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,31 @@ cdef class _Timestamp(ABCTimestamp):
984984
"""
985985
return super().day
986986
987+
@property
988+
def fold(self) -> int:
989+
"""
990+
Return the fold value of the Timestamp, which indicates whether the time is in the
991+
fold of a transition (typically during daylight saving time transitions).
992+
993+
Returns
994+
-------
995+
int
996+
The fold value of the Timestamp, where 0 indicates the first occurrence
997+
of the ambiguous time, and 1 indicates the second.
998+
999+
See Also
1000+
--------
1001+
Timestamp.dst : Return the daylight saving time (DST) adjustment.
1002+
Timestamp.tzinfo : Return the timezone information associated with the Timestamp.
1003+
1004+
Examples
1005+
--------
1006+
>>> ts = pd.Timestamp("2024-11-03 01:30:00", fold=1, tz="America/New_York")
1007+
>>> ts.fold
1008+
1
1009+
"""
1010+
return super().fold
1011+
9871012
@property
9881013
def month(self) -> int:
9891014
"""

0 commit comments

Comments
 (0)