Python 3 plot plot gives "ValueError: Masked arrays must be 1-D" although I don't use masked array

I am trying to plot a scatter using the .scatter method below. Here

ax.scatter(X[:,0], X[:,1], c = colors, marker = 'o', s=80, edgecolors = 'none')

with the following input classes / args:

X[:,0]] type: <class 'numpy.matrixlib.defmatrix.matrix'> X[:,1]] type: <class 'numpy.matrixlib.defmatrix.matrix'> colors type: <class 'list'>

however python throws a value error as shown here: error image

+4
source share
1 answer

Put this in parentheses:

plt.scatter([X[:,0]],[X[:,1]])
+8
source

Source: https://habr.com/ru/post/1678057/


All Articles