python what is numpy rand code example
Example 1: numpy generate random 2d array
import numpy as np
a=np.random.rand(3,3)
print(a)
Example 2: 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)