python 求均值、中位數、眾數的方法 ... import numpy as np counts = np.bincount(nums) #返回眾數np.argmax(counts) ... 然後再使用np.argmax就能得到眾數啦。
確定! 回上一頁