I am trying to plot clusters with unique color but getting error

前端 未结 1 681
迷失自我
迷失自我 2021-01-22 00:11

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

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-22 00:52

    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.

    0 讨论(0)
提交回复
热议问题