Created
August 14, 2020 22:38
-
-
Save Davidnet/b9a58b1e1f3b48be42e8ba0b9e6712c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dateutil.parser import parse, parserinfo | |
month_list = [(month[0:3], month) for month in ['enero', | |
'febrero', | |
'marzo', | |
'abril', | |
'mayo', | |
'junio', | |
'julio', | |
'agosto', | |
'septiembre', | |
'octubre', | |
'noviembre', | |
'diciembre'] ] | |
class SpanishParserInfo(parserinfo): | |
MONTHS = month_list | |
nutricion_df["Fecha Nto"] = nutricion_df["Fecha Nto"].transform(lambda date : parse(date, parserinfo=SpanishParserInfo(dayfirst=True), )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment