Skip to content

Commit 13cdd11

Browse files
authored
Docstring timestamps#59458 (#59644)
* fix pandas.Timestamp.fold GL08 * fix pandas.Timestamp.fold GL08 * remove i- pandas.Timestamp.fold GL08 * fix pre-commit error * fix docstring error
1 parent 8fa78ec commit 13cdd11

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
132132
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
133133
-i "pandas.TimedeltaIndex.seconds SA01" \
134134
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
135-
-i "pandas.Timestamp.fold GL08" \
136135
-i "pandas.Timestamp.max PR02" \
137136
-i "pandas.Timestamp.min PR02" \
138137
-i "pandas.Timestamp.nanosecond GL08" \

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,30 @@ 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.
991+
992+
Returns
993+
-------
994+
int
995+
The fold value of the Timestamp, where 0 indicates the first occurrence
996+
of the ambiguous time, and 1 indicates the second.
997+
998+
See Also
999+
--------
1000+
Timestamp.dst : Return the daylight saving time (DST) adjustment.
1001+
Timestamp.tzinfo : Return the timezone information associated.
1002+
1003+
Examples
1004+
--------
1005+
>>> ts = pd.Timestamp("2024-11-03 01:30:00")
1006+
>>> ts.fold
1007+
0
1008+
"""
1009+
return super().fold
1010+
9871011
@property
9881012
def month(self) -> int:
9891013
"""

0 commit comments

Comments
 (0)