Jul-16-2020, 12:10 AM
Hey guys,
I am working on a school project and need to make it so that i can import data from a CSV file into an array and use it to do calculations. I am able to import the file but when i do it imports as strings. I also need that data in an array. This is what i have:
Thanks for the help
I am working on a school project and need to make it so that i can import data from a CSV file into an array and use it to do calculations. I am able to import the file but when i do it imports as strings. I also need that data in an array. This is what i have:
import csv
x = []
y = []
with open('FinalData.csv') as csvfile:
csvReader = csv.reader(csvfile)
for row in csvReader:
x.append(row[0]), y.append(row[1])
print(x,y)It will print the arrays but the number values will be strings. Any idea how to change?Thanks for the help
