【pythonメモ】numpyメソッド randn max sum
random randn
標準正規分布を出力(標準0、分散1)
import numpy as np >>> np.random.randn() #-0.728737781876976 >>> np.random.randn(2,3) #2×3 array([[-0.01827125, -0.38984807, 0.08674773], [ 0.68593183, 0.82708901, -0.15050036]])
max
配列の中の最大値を出力
>>> np.random.randn(2).max() 2
sum(axis)
>>> np.array([1,2]).sum() 3