My data frame looks like -
serial_no text
23 {'Headers': ['LA-Spanish (Español)[Change]',
'5790B/5/AF Addendum', 'Secondary menu'], 'Divs': ['',
'Document(s):5790B/5/AF Addendum (168.88 KB)5790B/5/AF
AddendumN.º de revisión:00']}
25 {'Headers': ['LA-Spanish (Español)[Change]',
'700HPPK Service Information', 'Secondary menu'],
'Paragraphs': [], 'Tables': [], 'Lists': ["
['Disclaimer', 'Declaración de privacidad', 'Terms
of Use', 'Términos y Condiciones']"], 'Divs': ['',
'Document(s):700HPPK Service Information (3.36
MB)N.º de revisión:00']}
I want to convert the text column to english language. But that column store in a key value format. My code is given below -
import pandas as pd
from googletrans import Translator
translator = Translator()
df['text2'] = df['text'].apply(lambda x: translator.translate(x, dest='en').text)
I am getting below error -
AttributeError: 'NoneType' object has no attribute 'group'