Numpy generates random matrix

import numpy as np
from numpy import random as rad
Generate random matrix Explanation
rad.seed(n), n is an integer Determine the random number generation seed
rad.rand(n), n is an integer Generate n uniformly distributed sample values ​​(0, 1)
rad.randint (begin, end, n) Generate n random integers from the given range (begin,end)
rad.randn(N,M,...) Generate a normal distribution matrix of N*M*... (mean value is 0, standard deviation is 1)
rad.normal(size=(N,M,...)) Generate other normal distribution matrices of N*M*...
rad.uniform(min,max) Generate a randomly distributed sample value in the range of (min,max)
rad.beta (array1, array2) Generate the sample value of the beta distribution, the parameter must be greater than 0
rad.gamma () Generate sample values ​​of gamma distribution

 

Guess you like

Origin blog.csdn.net/weixin_43217427/article/details/107744866