Skip to content
Advertisement

Pandas data frame how to make a scatter plot for clustering a list of values into a set of groups

I have this pandas df with 2 columns

JavaScript

and I want to create a plot that clusters the drugs into their target, so there will be 7 clusters (7 targets) , I am not sure how to do it..

This is the df:

JavaScript

Advertisement

Answer

You can plot scatterplot with seaborn like below: (Because you say in the comments of other answer, You have problem with answer, I send another answer with another approach.)

JavaScript

Output:

enter image description here

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement