Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation (Issue #59458) (#59590)
Browse files Browse the repository at this point in the history
* adding docstring for pandas.Timestamp.day property

* fixing type annotation
  • Loading branch information
ankit-dhokariya authored Aug 25, 2024
1 parent dca2635 commit 2130a99
Show file tree
Hide file tree
Showing 2 changed files with 23 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 @@ -168,7 +168,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.day GL08" \
-i "pandas.Timestamp.fold GL08" \
-i "pandas.Timestamp.hour GL08" \
-i "pandas.Timestamp.max PR02" \
Expand Down
23 changes: 23 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,29 @@ cdef class _Timestamp(ABCTimestamp):
"""
return ((self.month - 1) // 3) + 1
@property
def day(self) -> int:
"""
Return the day of the Timestamp.

Returns
-------
int
The day of the Timestamp.

See Also
--------
Timestamp.week : Return the week number of the year.
Timestamp.weekday : Return the day of the week.

Examples
--------
>>> ts = pd.Timestamp("2024-08-31 16:16:30")
>>> ts.day
31
"""
return super().day
@property
def week(self) -> int:
"""
Expand Down

0 comments on commit 2130a99

Please sign in to comment.