elif all(isinstance(el, str) for el in point_colors):
point_colors = group_by_category(point_colors)
categories = list(set(np.sort(point_colors)))
x_stacked = np.vstack(x)
x_reshaped = [[] for i in categories]
for idx,point in enumerate(point_colors):
x_reshaped[categories.index(point)].append(x_stacked[idx])
x = [np.vstack(i) for i in x_reshaped]
if "style" in kwargs:
After Change
cluster_labels = get_clusters(x, ndims, n_clusters)
x = reshape_data(x,cluster_labels)
del kwargs["n_clusters"]
if "point_colors" in kwargs:
warnings.warn("n_clusters overrides point_colors, ignoring point_colors.")
del kwargs["point_colors"]