1. 生成随机的二维数据: import numpy as np x1 = np.array([1, 2, 3, 1, 5, 6, 5, 5, 6, 7, 8, 9, 9]) x2 = np.array([1, 3, 2, 2, 8, 6, 7, 6, 7, 1, 2, 1, 3]) x = np.array(list(zip(x1, x2))).reshape(len(x1), 2) #先将x1和x2用zip组合,然后再转换成list,最后reshape print (x) 2.生成聚类标签:…