使用python-numpy计算均值、中位数、众数方法 均值:np.mean() 中位数:np.median() 众数在numpy中没有直接计算的函数。 需要借助counts = np.dincount()、np.argmax(counts)方可计算。 具体方法,参考下图: