Skip to content

Commit

Permalink
DOC: Update month_name and day_name docstrings (pandas-dev#22544)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peque authored and victor committed Sep 30, 2018
1 parent 06a2762 commit 435fe26
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,17 +771,27 @@ def month_name(self, locale=None):
"""
Return the month names of the DateTimeIndex with specified locale.
.. versionadded:: 0.23.0
Parameters
----------
locale : string, default None (English locale)
locale determining the language in which to return the month name
locale : str, optional
Locale determining the language in which to return the month name.
Default is English locale.
Returns
-------
month_names : Index
Index of month names
Index
Index of month names.
.. versionadded:: 0.23.0
Examples
--------
>>> idx = pd.DatetimeIndex(start='2018-01', freq='M', periods=3)
>>> idx
DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31'],
dtype='datetime64[ns]', freq='M')
>>> idx.month_name()
Index(['January', 'February', 'March'], dtype='object')
"""
if self.tz is not None and self.tz is not utc:
values = self._local_timestamps()
Expand All @@ -797,17 +807,27 @@ def day_name(self, locale=None):
"""
Return the day names of the DateTimeIndex with specified locale.
.. versionadded:: 0.23.0
Parameters
----------
locale : string, default None (English locale)
locale determining the language in which to return the day name
locale : str, optional
Locale determining the language in which to return the day name.
Default is English locale.
Returns
-------
month_names : Index
Index of day names
Index
Index of day names.
.. versionadded:: 0.23.0
Examples
--------
>>> idx = pd.DatetimeIndex(start='2018-01-01', freq='D', periods=3)
>>> idx
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'],
dtype='datetime64[ns]', freq='D')
>>> idx.day_name()
Index(['Monday', 'Tuesday', 'Wednesday'], dtype='object')
"""
if self.tz is not None and self.tz is not utc:
values = self._local_timestamps()
Expand Down

0 comments on commit 435fe26

Please sign in to comment.