dflt_col = '#808080'
D_leaf_colors = {'attr_1': dflt_col, 'attr_4': '#B061FF', 'attr_5':
    '#B061FF', 'attr_2': '#B061FF', 'attr_8': '#B061FF', 'attr_6':
    '#B061FF', 'attr_7': '#B061FF', 'attr_0': '#61ffff', 'attr_3':
    '#61ffff', 'attr_9': '#61ffff'}
link_cols = {}
for i, i12 in enumerate(Z[:, :2].astype(int)):
    c1, c2 = (link_cols[x] if x > len(Z) else D_leaf_colors['attr_%d' % x] for
        x in i12)
link_cols[i + 1 + len(Z)] = c1 if c1 == c2 else dflt_col
D = dendrogram(Z=Z, labels=DF_dism.index, color_threshold=None,
    leaf_font_size=12, leaf_rotation=45, link_color_func=lambda x: link_cols[x]
    )
Custom cluster colors of SciPy dendrogram in Python (link_color_func?)