Out of range .csv py


I am trying to extract values from .csv file the problem is i getting an error out of range when using a file with over 6000 data, however when using file with about 200
There is such an error

import csv

# Read the csv file and store the data in a list

data = []

with open('waves_Output_mono.csv', 'r') as csvfile: 

    csvreader = csv.reader(csvfile, delimiter='t') 

    for row in csvreader: 



# Extract the x and y values from the data list  

y_values = [float(y[1]) for y in data] 

x_values = [float(x[0]) for x in data]

When i print the data it can print normally


Try processing the data with a for so you can print the values:

for value in data:
    x = float(value[0])
    y = float(value[1])

This is more code but can help you to identify where is the problem

Answered By: Gonzalo Odiard
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.