Python | Numpy Quiz | Question 19

Last Updated :
Discuss
Comments

Write code to normalize a NumPy array arr by scaling its values to be between 0 and 1.

normalized_arr = (arr - arr.min()) / (arr.max() - arr.min())

normalized_arr = np.scale(arr)

normalized_arr = arr.normalize()

normalized_arr = (arr - arr.mean()) / arr.std()

Share your thoughts in the comments