Skip to content

Commit 2130a99

Browse files
DOC: Enforce Numpy Docstring Validation (Issue #59458) (#59590)
* adding docstring for pandas.Timestamp.day property * fixing type annotation
1 parent dca2635 commit 2130a99

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Diff for: ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
168168
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
169169
-i "pandas.TimedeltaIndex.seconds SA01" \
170170
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
171-
-i "pandas.Timestamp.day GL08" \
172171
-i "pandas.Timestamp.fold GL08" \
173172
-i "pandas.Timestamp.hour GL08" \
174173
-i "pandas.Timestamp.max PR02" \

Diff for: pandas/_libs/tslibs/timestamps.pyx

+23
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,29 @@ cdef class _Timestamp(ABCTimestamp):
961961
"""
962962
return ((self.month - 1) // 3) + 1
963963
964+
@property
965+
def day(self) -> int:
966+
"""
967+
Return the day of the Timestamp.
968+
969+
Returns
970+
-------
971+
int
972+
The day of the Timestamp.
973+
974+
See Also
975+
--------
976+
Timestamp.week : Return the week number of the year.
977+
Timestamp.weekday : Return the day of the week.
978+
979+
Examples
980+
--------
981+
>>> ts = pd.Timestamp("2024-08-31 16:16:30")
982+
>>> ts.day
983+
31
984+
"""
985+
return super().day
986+
964987
@property
965988
def week(self) -> int:
966989
"""

0 commit comments

Comments
 (0)