Below is my code but I'm getting ValueError
. My input is from CSV file containing integers, but unable to import them:
import csv
excel_1 = open(r"C:\Users\JP Dayao\Desktop\Python files\test_file.csv")
raw_1 = csv.reader(excel_1)
t_ijklm = []
for i in raw_1:
for j in i:
t_ijklm.append(int(j))
excel_1.close()
Output (with error):
ValueError Traceback (most recent call last)
Input In [5], in <cell line: 17>()
17 for i in raw_1:
18 for j in i:
---> 19 t_ijklm.append(int(j))
20 excel_1.close()
22 #import constraints data
ValueError: invalid literal for int() with base 10:
Contents of CSV file:
21;19;21;19;24;23;35;35;36;35;36;35;35;23;22;30;23;36;23;26;25;25;40;25;40;25;22;21;21;25;20;25;22;22;18;19;25;18;25;17;23;20;24;24;22;24;21;22;23;21;27;22;36;23;25;29;29;23;28;33;29;31;19;26;32;20;35