This is a question related to the string index out of range error that came out when I tried to change the string by mistake

Asked 2 weeks ago, Updated 2 weeks ago, 0 views

I'm a beginner! I keep getting these errors, so I don't know why...

import csv 

f = open ('complexity_20191231.csv')         
confuse = csv.reader(f) 
confuse = list(confuse)


for row in confuse:
    for i in range(1,42):
        if i>=5:
            row[i] = float(row[i])


2022-09-20 08:43

1 Answers

Don't suffer, use the panda read_csv.

2022-09-20 08:43

If you have any answers or tips

© 2022 pinfo. All rights reserved.