I am working on a clustering algorithm which takes input from an excel file imported with pandas as a list. The list is divided into data blocks of like 8 floating points represented by k[0], k[1].....k[7]
(the index numbers correspond to values in the dictionary). The cluster is represented in dictionary form. An example of my cluster output is
cluster = {0: [0, 2, 4, 5, 6], 1: [1], 2: [3, 7]}
Is there a way to have a scatter plot so that [0, 2, 4, 5, 6]
is plotted with one color, [1]
in another color, [3,7]
in another color. Essentially, each cluster should be marked with the same color. I would like to know how to map this list to colors (preferably as many colors as the number of clusters in the clustering algorithm which is known beforehand). I am working with matplotlib in python and am completely lost as to how to solve this problem.