Skip to content

Commit 1b473a7

Browse files
committed
DOC: Update month_name and day_name docstrings
- To fix confusing `month_index` return name in `day_name` method - To better match the preferred docstring style.
1 parent 6b83df9 commit 1b473a7

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

pandas/core/arrays/datetimes.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -793,17 +793,18 @@ def month_name(self, locale=None):
793793
"""
794794
Return the month names of the DateTimeIndex with specified locale.
795795
796+
.. versionadded:: 0.23.0
797+
796798
Parameters
797799
----------
798-
locale : string, default None (English locale)
799-
locale determining the language in which to return the month name
800+
locale : str, optional
801+
Locale determining the language in which to return the month name.
802+
Default is English locale.
800803
801804
Returns
802805
-------
803-
month_names : Index
804-
Index of month names
805-
806-
.. versionadded:: 0.23.0
806+
Index
807+
Index of month names.
807808
"""
808809
if self.tz is not None and self.tz is not utc:
809810
values = self._local_timestamps()
@@ -819,17 +820,18 @@ def day_name(self, locale=None):
819820
"""
820821
Return the day names of the DateTimeIndex with specified locale.
821822
823+
.. versionadded:: 0.23.0
824+
822825
Parameters
823826
----------
824-
locale : string, default None (English locale)
825-
locale determining the language in which to return the day name
827+
locale : str, optional
828+
Locale determining the language in which to return the day name.
829+
Default is English locale.
826830
827831
Returns
828832
-------
829-
month_names : Index
830-
Index of day names
831-
832-
.. versionadded:: 0.23.0
833+
Index
834+
Index of day names.
833835
"""
834836
if self.tz is not None and self.tz is not utc:
835837
values = self._local_timestamps()

0 commit comments

Comments
 (0)