0

I've been trying to get the name of the month from a datetime series in a language other than English using panda's month_name on Windows.

According to the function's definition, I only need to set the locale parameter to the language code I want but I keep getting 'Error: unsupported locale setting'.

What could be the problem? Is there a way to get the current locales available to pandas?

Venide
  • 5
  • 2
  • you need to update your locale using the locale module `import locale; locale.getlocale();locale.setlocale(args)` – Umar.H Jan 15 '21 at 05:04

1 Answers1

1

In bash, execute locale -a to get locale

obj = pd.to_datetime('2021-01-15')
obj.month_name(locale ='en_US.utf8') 

more info:

Ferris
  • 5,325
  • 1
  • 14
  • 23