“Numpy normalisieren” Code-Antworten

Numpy Normalverteilung

>>> mu, sigma = 0, 0.1 # mean and standard deviation
>>> s = np.random.normal(mu, sigma, 1000)
Difficult Dunlin

Numpy normalisieren

def normalize(v):
    norm = np.linalg.norm(v)
    if norm == 0: 
       return v
    return v / norm
Ferry_Morris

Normalisieren Sie Numpy Array

 norm = np.linalg.norm(an_array_to_normalize)

    normal_array = an_array_to_normalize/norm

or for pixels to be obtained in my case. This can be used to map values to another scale from the current scale of values.

    scaled_array = (array/np.float(np.max(array)) )*255.
Nutty Nightingale

Ähnliche Antworten wie “Numpy normalisieren”

Fragen ähnlich wie “Numpy normalisieren”