Data Science, Artificial Intelligence, Open Data, Open Source, Data Vizualisation.
from model uniqueLabels = sorted(np.unique(model.labels_)) # create a custom subpalette from the unique labels # this will return npsTemp = nps([x / max(uniqueLabels) for x in uniqueLabels]) # add integer cluster labels to input dataframe df2 = df.assign(cluster = model.labels_) # iterate through