Note that there are some explanatory texts on larger screens.

plurals
  1. POCheck if the first 24 values of an array are not empty
    primarykey
    data
    text
    <p>I've an array called <code>totalist</code> with a list of some stuff. What I want to do, is for each line of <code>totalist</code>to check if the first 24 values are not empty, I dont care the rest ones.</p> <p><code>totalist</code> contains lines with something like:</p> <pre><code>totalist = [ ['stuff1', '33.0', '5.0', '165.0', '6.0', '990.0', '880.0', '95.0', '19.0', '3135.0', '4.0', '0.666666666667', '3.83333333333', '330.0', '9.5', '4.75', '3.16666666667', '225.0', '13.9333333333', '6.96666666667', '15.6666666667', '4.64444444444', 'cba', '0.1', '', '', 'test', '40.0', '3.0', '120.0', '4.0', '480.0', '480.0', '24.0', '8.0', '960.0', '', '0.0', '2.0', 'testing', '0.1', '', '', '', 'asdf', '2034', '123', '34', '23', '4', '56', 'asd', 'ok', 'cruz', 'reti', 'clip', 'twp', 'three', 'pedr', 'dcheck', '1-4'], ['stuff2', '40.0', '3.0', '120.0', '5.0', '600.0', '552.0', '24.0', '8.0', '960.0', '2.0', '0.4', '2.0', '200.0', '4.8', '2.4', '1.6', '200.0', '4.8', '2.4', '2.0', '1.6', 'qw', '0.1', '', '', 'Mec', '34.0', '6.0', '204.0', '4.0', '816.0', '714.0', '75.0', '12.5', '2550.0', '2.0', '0.5', '3.625', '123', '0.1', '', '123', 'vve', '', '4.0', '4.0', '4.0', '4.0', '8.0', '6.0', '4.0', '4.0', '6.0', '6.0', '4.0', '4.0', '4.0', '4.0', '4.0', '4.0'], ['stuff3 ', '34.0', '6.0', '204.0', '6.0', '1224.0', '1156.0', '75.0', '12.5', '3840.0', '2.0', '0.333333333333', '3.47058823529', '600.0', '6.4', '3.2', '2.13333333333', '190.0', '20.2105263158', '10.1052631579', '33.173374613', '6.73684210526', 'rem', '0.1', '', '', 'tapa', '24.0', '8.0', '192.0', '4.0', '768.0', '672.0', '73.0', '9.125', '1752.0', '2.0', '0.5', '2.78125', 'hem', '0.1', '', '', 'sock', '3.0', '', '4.0', '4.0', '4.0', '8.0', '6.0', '4.0', '4.0', '6.0', '6.0', '4.0', '4.0', '4.0', '4.0', '4.0', '4.0'], ] </code></pre> <p>So for example, in the first line, I want to check if the values from <code>stuff1</code> to <code>0.1</code> are not empty.</p> <p>What I'm trying to iterate by using xrange:</p> <pre><code>for i in xrange(len(totalist)): print totalist[i] </code></pre> <p>That prints me all the lines, but Im stuck when I have iterate every line from 0 to 23. <br> Any help is much appreciated. Thanks</p>
    singulars
    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.
    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