Answers for "numpy array normal distribution"

4

numpy normal distribution

>>> mu, sigma = 0, 0.1 # mean and standard deviation
>>> s = np.random.normal(mu, sigma, 1000)
Posted by: Guest on May-12-2020
0

how to normalize a 1d numpy array

# Foe 1d array
an_array = np.array([0.1,0.2,0.3,0.4,0.5])

norm = np.linalg.norm(an_array)
normal_array = an_array/norm
print(normal_array)

#[0.2,0.4,0.6,0.8,1] (Should be, I didin't run the code)
Posted by: Guest on May-13-2020

Code answers related to "numpy array normal distribution"

Python Answers by Framework

Browse Popular Code Answers by Language