[Python] How to calculate the total of each list, in a list of lists Python

Discussão em 'Python' iniciado por Stack, Março 10, 2025.

  1. Stack

    Stack Membro Participativo

    I have collected a list of lists, each list representing data from a single day. I need to find the SUM of these to calculate the total volume each day. I can only seem to add together each list, not an individual lists data.

    Provides the total of all the lists, not each individual lists total.

    for ele in range(0, len(y_pred)):
    total = total + y_pred[ele]


    print (total)


    Expected 18 outputs, each lists sum, not one output with a sum of everything.

    Continue reading...

Compartilhe esta Página