I'm trying to multiply 2 vectors using numpy and compare them, for some reasong it gives me error.. the data is from a CSV file I have found
The truth value of an array with more than one element is ambigous when trying to index an array
and more case of this type, but it is really different from my case.. my code:
import sys
import numpy as np
data = np.loadtxt(sys.argv[1], delimiter = ',')
X = data[:, 1:]
Y = data[:, 0]
#argv[1] is mnist_train_1vs7vs8.csv
wMatrix=(3,len(X[0]))
np.zeros(wMatrix)
for i in range(0,len(Y)):
maxWx=0
for wIndex in range (0,1):
if ( np.dot(wMatrix[wIndex] ,X[i]) < np.dot(wMatrix[wIndex+1],X[i]) ):
maxWx=wIndex+1
it gives me error:
ValueError: The truth value of an array with more than one element is
ambiguous.
Use a.any() or a.all()`
I'm just trying to multiply a vector with a vector of the same size, and i don't understand why it won't let me.. HELP..?