Skip to content

Instantly share code, notes, and snippets.

@Davidnet
Created August 14, 2020 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Davidnet/b9a58b1e1f3b48be42e8ba0b9e6712c9 to your computer and use it in GitHub Desktop.
Save Davidnet/b9a58b1e1f3b48be42e8ba0b9e6712c9 to your computer and use it in GitHub Desktop.
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