📅  最后修改于: 2022-03-11 14:45:17.275000             🧑  作者: Mango
import numpy as np
a = [[1,2],[3,4]]
np.mean(a) # (1+2+3+4)/4 = 2.5
np.mean(a, axis=0) # [mean(1,3), mean(2,4)] = [2.0, 3.0]
np.mean(a, axis=1) # [mean(1,2), mean(3,4)] = [1.5, 2.5]