Answers for "numpy normalize data"

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
2

numpy normalize

def normalize(v):
    norm = np.linalg.norm(v)
    if norm == 0: 
       return v
    return v / norm
Posted by: Guest on November-09-2020
2

numpy normalize matrix

import numpy as np
x= np.random.random((3,3))
print("Original Array:")
print(x)
xmax, xmin = x.max(), x.min()
x = (x - xmin)/(xmax - xmin)
print("After normalization:")
print(x)
Posted by: Guest on February-12-2021

Python Answers by Framework

Browse Popular Code Answers by Language