test_labels_all = [1, 1, 2, 2, 2, 4, 6, 6]
## 去除重复数字
list1 = list(set(test_labels_all))
print(list1)
--->[1, 2, 4, 6]
###统计重复数字出现个数
a = {}
for i in test_labels_all:
a[i] = test_labels_all.count(i)
print(a)
#或者
set_one = set(test_labels_all)
for item in set_one:
print(item, test_labels_all.count(item))