[Python] How to add a new row to an existing DataFrame which is the sum of two rows?

Discussão em 'Python' iniciado por Stack, Fevereiro 1, 2025.

  1. Stack

    Stack Membro Participativo

    I have a DataFrame looks as follow:

    Name1 Name2
    Val1 1.2 2.2
    Val2 2.3 4.2


    What I want is as follow:

    Name1 Name2
    Val1 1.2 2.2
    Val2 2.3 4.2
    Val3 0.52 0.52


    The values in Val3 is Val1/Vals2.

    How to do that?

    Continue reading...

Compartilhe esta Página