Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
Special text to latin characters in python

I have the following pandas data frame:

the_df = pd.DataFrame({'id':[1,2],'name':['Joe','𝒮𝒶𝓇𝒶𝒽']})
the_df
    id  name
0   1   Joe
1   2   𝒮𝒶𝓇𝒶𝒽

As you can see, we can read the second name as "Sarah", but it's written with special characters.

I want to create a new column with these characters converted to latin characters. I have tried this approach:

the_df['latin_name'] = the_df['name'].str.extract(r'(^[a-zA-Z\s]*)')
the_df
    id  name    latin_name
0   1   Joe     Joe
1   2   𝒮𝒶𝓇𝒶𝒽  

But it doesn't recognize the letters. Please, any help on this will be greatly appreciated.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Try .str.normalize

the_df['name'].str.normalize('NFKC').str.extract(r'(^[a-zA-Z\s]*)')

Output:

       0
0    Joe
1  Sarah
over 4 years ago · Santiago Trujillo Denunciar

0

You can use unicodedata.normalize:

>>> import unicodedata
>>> df['name'].apply(lambda x: unicodedata.normalize('NFKD', x))
0      Joe
1    Sarah
Name: name, dtype: object
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda