I have a pandas dataframe with the date column containing dates with month abbreviations in French, such as:
u'18-oct.-2015'
u'12-nov.-2015'
u'02-d\xe9c.-2015'
u'26-janv.-2016'
u'02-f\xe9vr.-2016'
u'31-mai-2016'
u'01-juin-2016'
What is the proper way of using to_datetime to parse them?
I suspect that you can just set your locale:
import locale
locale.setlocale(locale.LC_ALL, 'fr_FR') # Windows may be a different locale name
# do your pandas read here
You might need to tell Pandas that that column is a datetime column... though it's also possible that you'll need to fix the column values - jan is the appropriate abbreviation for janvier. But Pandas may be smart enough to handle it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With