csv - python: list index of out of range -


  for line c: c1.append (row [0:13]) in line for c1: row (Float (row [13]) / 100) line .append (float (row [12]) / float (row [13]) / 100) row.append (math.log10 (float (line [12])) < There is a CSV file with many rows and columns in the code   

c c1 which contains a subset of c Only the first 14 elements

I am getting the index error: row.append (float (row [13]) / at category Every list index

Does anybody know what I am doing?

Rows in C1 are not actually 14 elements, they contain 13.

The second index in a single piece is unique when you type the line [0:13] to c1 , you add element 0 to element 13. Therefore, only 13 elements.

This is the reason That you get the index error: row.append (float ( The list listed out of range at line [13]) / 100. line [13] is an attempt to use a non-existent 14th element.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -