I am just trying to plot x, y and then color them with clusters. Each cluster should have unique color. But i am getting error. I tried without using numpy array but still getti
I was facing the same issue moments ago and stumbled across this post in searching for a solution. Things that I can definitively say:
In the line plt.scatter(x, y , c = label_color)
the shape of x
, y
, and c
needs to be the same and, I believe, all three are best if they are a pandas dataframe. The shape of all of my successful objects was (5113, 1)
rather than your (5113,)
. I recognize that you are testing the shape in your print()
statements, but something seems amiss.
I am by no means a professional and I may be wrong in some of this, but this was how I came to my own solution. Hopefully it might nudge you and others in the right direction.