pybrain
is using the result to slice a multidimensional array.
>>> a
array([[3, 1, 0, 2],
[1, 2, 1, 2],
[1, 3, 3, 0],
[0, 1, 0, 0]])
>>> b
array([3, 3, 1, 2])
>>> np.where(b==3)
(array([0, 1]),)
Using this naively will either return a higher dimensional array or do wonky things:
>>> a[np.where(b==3),0]
array([[3, 1]])
You can either unpack the tuple or do below to return the expected result:
>>> a[np.where(b==3)[0],0]
array([3, 1])
The reason this is dangerous:
>>> here, _ = np.where(b==3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: need more than 1 value to unpack
To change the above:
here= where(tstdata['class']==c)
plot(tstdata['input'][here[0], 0], tstdata['input'][here[0], 1], 'o')