np.random.rand()*scale code example
Example 1: np.random.randn()
>>> 2.5 * np.random.randn(2, 4) + 3
array([[-4.49401501, 4.00950034, -1.81814867, 7.29718677], #random
[ 0.39924804, 4.68456316, 4.99394529, 4.84057254]]) #random
Example 2: np.random.randint to generate -1 +1
2 * np.random.randint(2, size=10) -1