[Python] Error "'DataFrame' object has no attribute 'append'"

Discussão em 'Python' iniciado por Stack, Janeiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to append a dictionary to a DataFrame object, but I get the following error:


    AttributeError: 'DataFrame' object has no attribute 'append'
    ​

    As far as I know, DataFrame does have the method "append".

    Code snippet:

    df = pd.DataFrame(df).append(new_row, ignore_index=True)


    I was expecting the dictionary new_row to be added as a new row.

    How can I fix it?

    Continue reading...

Compartilhe esta Página