Skip to content

Commit 448a023

Browse files
authored
DOC: improve Timestamps docstrings (#50873)
* DOC: improve Index docstrings * fix example * update Series.hanans docstring * DOC: improve docstrings
1 parent 76561d1 commit 448a023

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

pandas/_libs/tslibs/timestamps.pyx

+40
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,14 @@ cdef class _Timestamp(ABCTimestamp):
687687
"""
688688
Return True if date is first day of the year.
689689

690+
Returns
691+
-------
692+
bool
693+
694+
See Also
695+
--------
696+
Timestamp.is_year_end : Similar property indicating the end of the year.
697+
690698
Examples
691699
--------
692700
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -704,6 +712,14 @@ cdef class _Timestamp(ABCTimestamp):
704712
"""
705713
Return True if date is last day of the year.
706714

715+
Returns
716+
-------
717+
bool
718+
719+
See Also
720+
--------
721+
Timestamp.is_year_start : Similar property indicating the start of the year.
722+
707723
Examples
708724
--------
709725
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -785,6 +801,10 @@ cdef class _Timestamp(ABCTimestamp):
785801
"""
786802
Return True if year is a leap year.
787803

804+
Returns
805+
-------
806+
bool
807+
788808
Examples
789809
--------
790810
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -798,6 +818,10 @@ cdef class _Timestamp(ABCTimestamp):
798818
"""
799819
Return day of the week.
800820

821+
Returns
822+
-------
823+
int
824+
801825
Examples
802826
--------
803827
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -811,6 +835,10 @@ cdef class _Timestamp(ABCTimestamp):
811835
"""
812836
Return the day of the year.
813837

838+
Returns
839+
-------
840+
int
841+
814842
Examples
815843
--------
816844
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -824,6 +852,10 @@ cdef class _Timestamp(ABCTimestamp):
824852
"""
825853
Return the quarter of the year.
826854

855+
Returns
856+
-------
857+
int
858+
827859
Examples
828860
--------
829861
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -837,6 +869,10 @@ cdef class _Timestamp(ABCTimestamp):
837869
"""
838870
Return the week number of the year.
839871

872+
Returns
873+
-------
874+
int
875+
840876
Examples
841877
--------
842878
>>> ts = pd.Timestamp(2020, 3, 14)
@@ -850,6 +886,10 @@ cdef class _Timestamp(ABCTimestamp):
850886
"""
851887
Return the number of days in the month.
852888

889+
Returns
890+
-------
891+
int
892+
853893
Examples
854894
--------
855895
>>> ts = pd.Timestamp(2020, 3, 14)

0 commit comments

Comments
 (0)