在numpy/中scipy,是否有一种有效的方法来获取数组中唯一值的频率计数?
numpy
scipy
这些方面的东西:
x = array( [1,1,1,2,2,2,5,25,1,1] ) y = freq_count( x ) print y >> [[1, 5], [2,3], [5,1], [25,1]]
(对你来说,R用户在那里,我基本上都在寻找这个table()功能)
table()
python arrays performance numpy
arrays ×1
numpy ×1
performance ×1
python ×1