我有波兰语的 pandas 数据框列,想翻译成英语,但出现错误。下面的代码:
from googletrans import Translator
translator = Translator()
df['text_en'] = df2['text_pl'].apply(translator.translate, src='pl', dest='en')
下面的错误:
63
64 # this will be the same as python code after stripping out a reserved word 'var'
---> 65 code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '')
66 # unescape special ascii characters such like a \x3d(=)
67 if PY3: # pragma: no cover
AttributeError: 'NoneType' object has no attribute 'group'