I am currently working on a code for a perceptron that plots data in three dimensions. I am running it in terminal and when running the code I recieve this error:
Traceback (most recent call last):
File "perceptron2.py", line 70, in <module>
for row in csv_reader:
_csv.Error: new-line character seen in unquoted field - do you need to open the
file in universal-newline mode?
The area around line 70 of my code, where I believe the error is occuring is in the following block of code, in where input data is acquired from x and labels from y
X = np.zeros(shape=(80,2))
y = np.zeros(shape=(80,1))
z = np.zeros(shape=(80,0))
with open('joy.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
X[line_count] = [eval(row[0]), eval(row[1])]
y[line_count] = [eval(row[2])]
z[line_count] = [eval(row[3])]
line_count += 1
if line_count == 80:
break
Anyway, I was wondering if anybody knew of a solution I could implement to solve my problems. Thanks!