In [57]: dW = np.zeros((2,2), int)
In [58]: x = [[0,1,1,0,1, 0], [1, 1, 1, 1, 0, 0]]
In [59]: np.add.at(dW,x,1)
/home/infinity/anaconda3/bin/ipython:1: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
I was trying to create a confusion matrix using numpy, but I got the previous error. How can I fix that?
If we supply an array rather than a list, we don't get the future warning:
According to the docs,
Recent
numpyversions have been tightening the indexing rules. In the past lists were sometimes allowed in contexts that really expected tuples or arrays. This futurewarning is part of that tightening.===
As commented: