Oct-01-2019, 03:34 PM
Hi guys.
I have some trouble with this code. I want to store my data from a csv into an array - The data consist both of text, dates and numbers.
As I understand, it is because of the different types of datapoint it tries to store and it can only stores floats?
How would you guys store data in an array, if it consist of different datatypes ?
Thank you :)
I have some trouble with this code. I want to store my data from a csv into an array - The data consist both of text, dates and numbers.
import csv timestamp = [] shoeSize = [] program = [] height = [] why = [] with open('Data.csv', delimiter=';') as f: reader = csv.reader(f) for row in reader: timestamp.append[row[0]] shoeSize.append[row[1]] program.append[row[2]] height.append[row[3]] why.append[row[4]] print(timestamp)It returns the mistake: value is unsubscriptable python
As I understand, it is because of the different types of datapoint it tries to store and it can only stores floats?
How would you guys store data in an array, if it consist of different datatypes ?
Thank you :)