I want to translate a column [Month] that has values in English ("January", "February","March", etc) to French ("Janvier", "Février", "Mars", etc) . How can I do that please? Thank You
CodePudding user response:
In the benchmarks that I did in the past, map
was quite fast, as it works in a single column.
pandas.Series.map
Something like
df['month_EN']=df['month'].map({'Janvier':'January',...})
CodePudding user response:
I think "pandas.DataFrame.replace" might help. It is not a translation but can help you do the task.