Skip to content

Commit

Permalink
Docstring timestamps#59458 (#59644)
Browse files Browse the repository at this point in the history
* fix pandas.Timestamp.fold GL08

* fix pandas.Timestamp.fold GL08

* remove i- pandas.Timestamp.fold GL08

* fix pre-commit error

* fix docstring error
  • Loading branch information
uditbaliyan authored Aug 28, 2024
1 parent 8fa78ec commit 13cdd11
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
24 changes: 24 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit 13cdd11

Please sign in to comment.