diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 324305417a600..9012dc6559a13 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -132,7 +132,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.TimedeltaIndex.nanoseconds SA01" \ -i "pandas.TimedeltaIndex.seconds SA01" \ -i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \ - -i "pandas.Timestamp.fold GL08" \ -i "pandas.Timestamp.max PR02" \ -i "pandas.Timestamp.min PR02" \ -i "pandas.Timestamp.nanosecond GL08" \ diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index ec976f17af396..bdcb5e751c2a8 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -984,6 +984,30 @@ cdef class _Timestamp(ABCTimestamp): """ return super().day + @property + def fold(self) -> int: + """ + Return the fold value of the Timestamp. + + Returns + ------- + int + The fold value of the Timestamp, where 0 indicates the first occurrence + of the ambiguous time, and 1 indicates the second. + + See Also + -------- + Timestamp.dst : Return the daylight saving time (DST) adjustment. + Timestamp.tzinfo : Return the timezone information associated. + + Examples + -------- + >>> ts = pd.Timestamp("2024-11-03 01:30:00") + >>> ts.fold + 0 + """ + return super().fold + @property def month(self) -> int: """