📜  numpy 数组计数频率 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:48.932000             🧑  作者: Mango

代码示例1
import numpy as np

x = np.array([1,1,1,2,2,2,5,25,1,1])
unique, counts = np.unique(x, return_counts=True)

print np.asarray((unique, counts)).T