Skip to content

DOC: improve Timestamps docstrings #50873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,14 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return True if date is first day of the year.

Returns
-------
bool

See Also
--------
Timestamp.is_year_end : Similar property indicating the end of the year.

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand All @@ -704,6 +712,14 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return True if date is last day of the year.

Returns
-------
bool

See Also
--------
Timestamp.is_year_start : Similar property indicating the start of the year.

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand Down Expand Up @@ -785,6 +801,10 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return True if year is a leap year.

Returns
-------
bool

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand All @@ -798,6 +818,10 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return day of the week.

Returns
-------
int

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand All @@ -811,6 +835,10 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return the day of the year.

Returns
-------
int

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand All @@ -824,6 +852,10 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return the quarter of the year.

Returns
-------
int

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand All @@ -837,6 +869,10 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return the week number of the year.

Returns
-------
int

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand All @@ -850,6 +886,10 @@ cdef class _Timestamp(ABCTimestamp):
"""
Return the number of days in the month.

Returns
-------
int

Examples
--------
>>> ts = pd.Timestamp(2020, 3, 14)
Expand Down