Note that there are some explanatory texts on larger screens.

plurals
  1. POSumming the values in a list (python)
    primarykey
    data
    text
    <p>Hi all I am having trouble trying to sum all the values in a list. I'm not sure if this is actually possible first. </p> <pre><code>dL= list(csv.reader(input)) sL = dL [14247:14611] a = [row[5] for row in sL[1:]] print a </code></pre> <p>This code is what I have so far and produces the result </p> <pre><code>['5.0', '0.0', '0.0', '0.0', '0.0', '1.6', '4.4', '14.0', '0.0', '0.0', '0.8', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.2', '0.0', '0.0', '0.0', '0.0', '95.6', '63.6', '0.0', '0.0', '0.0', '9.0', '0.0', '0.0', '0.0', '0.0', '20.2', '14.4', '1.6', '0.0', '7.6', '2.4', '0.0', '11.4', '0.0', '79.4', '60.4', '27.2', '', '1.8', '0.0', '0.0', '29.6', '67.6', '2.2', '0.0', '0.0', '0.0', '14.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '', '3.2', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '6.2', '0.0', '0.0', '0.0', '0.8', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.2', '11.8', '2.4', '0.0', '0.0', '0.0', '0.4', '16.8', '8.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '2.6', '27.2', '77.0', '0.2', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.2', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '9.2', '2.6', '0.0', '0.2', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.2', '0.0', '0.0', '0.0', '0.0', '0.2', '0.0', '0.0', '0.0', '0.0', '1.6', '0.0', '0.0', '0.0', '0.0', '0.0', '6.8', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '', '', '', '', '', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '37.8', '0.2', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0'] </code></pre> <p>The above list is not typed but produced by the function code. Does this affect the result? </p> <p>Can anyone please assist me in showing me how to solve this problem and sum all these values in a code from this list. I believe I will have to join string to do so but am unsure. Can you please inform me whether this is possible to sum all these values of the list and if so how can I do it?</p> <p>EDIT: </p> <pre><code>THANKS FOR ALL THE HELP GUYS </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload