📅  最后修改于: 2022-03-11 14:46:34.750000             🧑  作者: Mango
代码示例3
arr = np.array( [1, 2, 3, 2, 1, 2])
occ = np.count_nonzero(arr==0)
print(occ)
0
occ = np.count_nonzero(arr==1)
print(occ)
2