@@ -793,17 +793,24 @@ def month_name(self, locale=None):
793
793
"""
794
794
Return the month names of the DateTimeIndex with specified locale.
795
795
796
+ .. versionadded:: 0.23.0
797
+
796
798
Parameters
797
799
----------
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.
800
803
801
804
Returns
802
805
-------
803
- month_names : Index
804
- Index of month names
806
+ Index
807
+ Index of month names.
805
808
806
- .. versionadded:: 0.23.0
809
+ Examples
810
+ --------
811
+ >>> idx = pd.DatetimeIndex(start='2018-09', freq='M', periods=3)
812
+ >>> idx.month_name()
813
+ Index(['September', 'October', 'November'], dtype='object')
807
814
"""
808
815
if self .tz is not None and self .tz is not utc :
809
816
values = self ._local_timestamps ()
@@ -819,17 +826,24 @@ def day_name(self, locale=None):
819
826
"""
820
827
Return the day names of the DateTimeIndex with specified locale.
821
828
829
+ .. versionadded:: 0.23.0
830
+
822
831
Parameters
823
832
----------
824
- locale : string, default None (English locale)
825
- locale determining the language in which to return the day name
833
+ locale : str, optional
834
+ Locale determining the language in which to return the day name.
835
+ Default is English locale.
826
836
827
837
Returns
828
838
-------
829
- month_names : Index
830
- Index of day names
839
+ Index
840
+ Index of day names.
831
841
832
- .. versionadded:: 0.23.0
842
+ Examples
843
+ --------
844
+ >>> idx = pd.DatetimeIndex(start='2018-09-02', freq='D', periods=3)
845
+ >>> idx.day_name()
846
+ Index(['Sunday', 'Monday', 'Tuesday'], dtype='object')
833
847
"""
834
848
if self .tz is not None and self .tz is not utc :
835
849
values = self ._local_timestamps ()
0 commit comments