@@ -1202,7 +1202,9 @@ def month_name(self, locale=None) -> npt.NDArray[np.object_]:
1202
1202
----------
1203
1203
locale : str, optional
1204
1204
Locale determining the language in which to return the month name.
1205
- Default is English locale.
1205
+ Default is English locale (``'en_US.utf8'``). Use the command
1206
+ ``locale -a`` on your terminal on Unix systems to find your locale
1207
+ language code.
1206
1208
1207
1209
Returns
1208
1210
-------
@@ -1229,6 +1231,17 @@ def month_name(self, locale=None) -> npt.NDArray[np.object_]:
1229
1231
dtype='datetime64[ns]', freq='M')
1230
1232
>>> idx.month_name()
1231
1233
Index(['January', 'February', 'March'], dtype='object')
1234
+
1235
+ Using the ``locale`` parameter you can set a different locale language,
1236
+ for example: ``idx.month_name(locale='pt_BR.utf8')`` will return month
1237
+ names in Brazilian Portuguese language.
1238
+
1239
+ >>> idx = pd.date_range(start='2018-01', freq='M', periods=3)
1240
+ >>> idx
1241
+ DatetimeIndex(['2018-01-31', '2018-02-28', '2018-03-31'],
1242
+ dtype='datetime64[ns]', freq='M')
1243
+ >>> idx.month_name(locale='pt_BR.utf8') # doctest: +SKIP
1244
+ Index(['Janeiro', 'Fevereiro', 'Março'], dtype='object')
1232
1245
"""
1233
1246
values = self ._local_timestamps ()
1234
1247
@@ -1246,7 +1259,9 @@ def day_name(self, locale=None) -> npt.NDArray[np.object_]:
1246
1259
----------
1247
1260
locale : str, optional
1248
1261
Locale determining the language in which to return the day name.
1249
- Default is English locale.
1262
+ Default is English locale (``'en_US.utf8'``). Use the command
1263
+ ``locale -a`` on your terminal on Unix systems to find your locale
1264
+ language code.
1250
1265
1251
1266
Returns
1252
1267
-------
@@ -1273,6 +1288,17 @@ def day_name(self, locale=None) -> npt.NDArray[np.object_]:
1273
1288
dtype='datetime64[ns]', freq='D')
1274
1289
>>> idx.day_name()
1275
1290
Index(['Monday', 'Tuesday', 'Wednesday'], dtype='object')
1291
+
1292
+ Using the ``locale`` parameter you can set a different locale language,
1293
+ for example: ``idx.day_name(locale='pt_BR.utf8')`` will return day
1294
+ names in Brazilian Portuguese language.
1295
+
1296
+ >>> idx = pd.date_range(start='2018-01-01', freq='D', periods=3)
1297
+ >>> idx
1298
+ DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'],
1299
+ dtype='datetime64[ns]', freq='D')
1300
+ >>> idx.day_name(locale='pt_BR.utf8') # doctest: +SKIP
1301
+ Index(['Segunda', 'Terça', 'Quarta'], dtype='object')
1276
1302
"""
1277
1303
values = self ._local_timestamps ()
1278
1304
0 commit comments