1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Loop through Python list to find spanish country and translate to english country...

Discussão em 'Python' iniciado por Stack, Setembro 12, 2024.

  1. Stack

    Stack Membro Participativo

    I am importing a column

    import pandas as pd
    from deep_translator import PonsTranslator

    df = pd.read_excel(r"myFile.xlsx")
    customerList = df['Customer Country'].head()

    #iterate through column and see what is NOT english and translate to english
    #for i in customerCouuntryList:


    the output of customerList is

    0 Portugal
    1 India
    2 Spain
    3 Spain
    4 Suecia
    Name: Sold To Customer Country, dtype: object


    what i am trying to do is iterate through my output and it is in english but some entries could appear in spanish. I want to translate that back into english.

    Any ideas?

    Continue reading...

Compartilhe esta Página