Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. x = [1, 2, 3, 4]
  2.  
  3. def normalize(x):
  4.  
  5. for i in range(len(x)):
  6. return [(x[i] - min(x)) / (max(x) - min(x))]
  7.  
  8. normalize(x):
  9.  
  10. [0.0]
  11.  
  12. [0.00, 0.33, 0.66, 1.00]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement