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

[Python] Removing _x000D_ from Text Records in Pandas Dataframe

Discussão em 'Python' iniciado por Stack, Setembro 28, 2024 às 03:42.

  1. Stack

    Stack Membro Participativo

    I have a Pandas data frame that I imported from an Excel file. One of the columns looks like the following:

    Link
    =========
    A-324
    A-76_x000D_\nA-676
    A-95
    A-95_x00D_n\nA-495
    ...


    I was able to use regex to remove the \n characters, but I am unable to remove _x000D_. Does anyone know what this is? Why am I unable to use traditional remove methods?

    Here is what I've done:

    dat['Link'] = dat['Link'].replace("_x000D_", " ")
    dat['Link'] = dat['Link'].replace(r'\s+|\\n', ' ', regex=True)

    Continue reading...

Compartilhe esta Página