0

I am trying to add 2 arrays together, and I found this, problem is, it gives me error for some reason and I don't know how to fix this. code:

import numpy as np
import math
import sys

# cd Desktop/python Exercises/pythonEx05
# python main.py mnist_train_1vs7vs8.csv mnist_validation_1vs7vs8.csv    
mnist_test_1vs7vs8.csv


# Loads the dataset
data = np.loadtxt(sys.argv[1],  delimiter = ',')
# Split the data to matrix X and vector Y
X = data[:, 1:]
Y = data[:, 0]

wMatrix=(len(X[0]),3)
np.zeros(wMatrix)

for i in range(0,len(Y)):
        if(yGag!=Y[i]):  #Y[i] is the right y, to fix later
            wMatrix[i]= [a + c for a, c in 
            zip(wMatrix[i], X[i])]

The last line gives me error

  argument1 does not support iteration

..HELP? its just adding 2 arrays, that's all

Cœur
  • 37,241
  • 25
  • 195
  • 267
aviadm71
  • 53
  • 1
  • 9

0 Answers0