I'm trying to convert non-English languages to English using TextBlob translate function. My data set is based on Pandas data frame.
I understood that it worked in non-Pandas data frame context. For example,
what=TextBlob("El apartamento de Evan esta muy bien situado, con fcil acceso al cualquier punto de Manhattan gracias al metro.")
whatt=what.translate(to= 'en')
print (whatt)
But based on Pandas data frame, TextBlob translate wouldn't work properly.
I searched for a way to address this and found the code but gave me a different error message. Could anyone help me with this?
data["comments"] = data["comments"].str.encode('ISO 8859-1', 'ignore').apply(lambda x: TextBlob(x.strip()).translate(to='en'))
TypeError: cannot use a string pattern on a bytes-like object