Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- data = []
- with open('test.csv', newline='') as csvfile:
- csvreader = csv.reader(csvfile, delimiter=',', quotechar='"')
- for row in csvreader:
- data_row = []
- for column in row:
- try:
- data_row.append(float(column.replace(',', '.')))
- except:
- print("Couldn't convert data. Skipping value.")
- if data_row != []:
- data.append(data_row)
- pprint.pprint(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement