Reputation: 2130
I have a dataframe with a Date
column in format "Jan 20, 2019" or "Feb 01, 2019". This is of course, english. But my locale is spanish (ES), I think it must be something with the locale, because if I do
pd.to_datetime('Feb 01, 2019', format='%b %m, %Y')
it works, I believe is because February (Feb) is the same as Febrero (Feb), but if I do
pd.to_datetime('Jan 01, 2019', format='%b %m, %Y')
I think that's because January (Jan) is different from Enero (Ene), so before my processing I did:
import locale
locale.setlocale(locale.LC_ALL, 'EN')
But it's not working either. I'm pretty sure my format string is okay, but I'm not completely sure. Should I have to "translate" components into something easier to understand like %m/%d/%Y?
Upvotes: 1
Views: 555