random rand code example
Example 1: random matrix python
np.random.rand(3,2)
Example 2: numpy generate random 2d array
import numpy as np
a=np.random.rand(3,3)
print(a)
Example 3: numpy randn with a shape of another array
a = np.zeros([2, 3])
print(a.shape)
# outputs: (2, 3)
b = np.random.randn(*a.shape)
print(b.shape)
# outputs: (2, 3)