I'm dealing with a set of 173k points labelized into 160 groups. I'd like to reduce this number of groups/clusters by merging the closest (to 9 or 10 groups). I've searched for sklearn or alike libraries, but with no success.
I guess it's simply clustering by knn not points but groups of same labelized points.
As graphics are most of the time better explanations, here is a simplified version of what I'd like :

Thanks for the help