1

I have a dataframe that looks like:

words
Atlántica
Común
Guión

and I want to remove all accents from each elemnt.

What I'm doing is:

from unidecode import unidecode
unidecode.unidecode(df['words'])

as a result I'm obtaining an error message that says:

'function' object has no atribute 'unidecode'

Can anyone help me? Regards

Mustafa Aydın
  • 17,645
  • 4
  • 15
  • 38
alelew
  • 173
  • 3
  • 13
  • Does this answer your question? [How to remove accents from values in columns?](https://stackoverflow.com/questions/37926248/how-to-remove-accents-from-values-in-columns) – Henry Ecker May 12 '21 at 18:24

1 Answers1

2

You're importing unidecode and then calling it again as an attribute. Try this:

from unidecode import unidecode
unidecode(df['words'])

Based on the error ('Series' object hast no attribute 'encode') you're getting after trying this, my guess would be this should work:

df['words'] = df['words'].apply(unidecode)
Shivam Roy
  • 1,961
  • 3
  • 10
  • 23