numpy创建矩阵常用方法 arange+reshape in: n = np.arange(0, 30, 2)# start at 0 count up by 2, stop before 30 n = n.reshape(3, 5) # reshape array to be 3x5 1 2 out: linspace+resize in: o = np.linspace(0, 4, 9) o.resize(3, 3) 1 2 out: notice:reshape与resize区别 one…