You can compensate the entire array by the smallest (left left) array. What you get may not really be a “normal distribution,” but as part of your work on the final array, you can make sure that the values are positive and that they correspond to the bell curve.
>>> mu,sigma = (0,1.0) >>> s = np.random.normal(mu, 1.0, 100) >>> s array([-0.58017653, 0.50991809, -1.13431539, -2.34436721, -1.20175652, 0.56225648, 0.66032708, -0.98493441, 2.72538462, -1.28928887]) >>> np.min(s) -2.3443672118476226 >>> abs(np.min(s)) 2.3443672118476226 >>> np.add(s,abs(np.min(s))) array([ 1.76419069, 2.85428531, 1.21005182, 0. , 1.14261069, 2.90662369, 3.00469429, 1.3594328 , 5.06975183, 1.05507835])
Benny
source share