This might be a duplicated question but since I have read all the comments about it and I don't solve my question I have to ask again.
I am working with a dataframe where I Have a column with this look:
print final['fecha_dato'][2]
31 de Enero del 2017
I do this in order to make it more understandable:
d = final['fecha_dato'][2]
d = d.replace(' de ','-')
d = d.replace(' del ','-')
And i get this output: '31-Enero-2017'
I want to convert it to 31-01-2017 format and I try this in order to make the Spanish understandable:
locale.setlocale(locale.LC_ALL, 'en_US')
but it says: unsupported locale setting.
Once i've done this I guess I will have to do something like this:
datetime.strptime('6-Mar-2016', '%d-%b-%Y').strftime('%Y-%m-%d')
Let's see what is the problem. If you can give me a way of using the replace in just one sentence that would be great too. Thanks in advance!!