Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import numpy as np
  2.  
  3. rawpoints = np.array(
  4. [[2500, 0.15, 12],
  5. [1200, 0.65, 20],
  6. [6200, 0.35, 19]]
  7. )
  8.  
  9. # Scale the rawpoints array so that each "column" is
  10. # normalized to the same scale
  11. # Linear stretch from lowest value = 0 to highest value = 100
  12. high = 100.0
  13. low = 0.0
  14.  
  15. mins = np.min(rawpoints, axis=0)
  16. maxs = np.max(rawpoints, axis=0)
  17. rng = maxs - mins
  18.  
  19. scaled_points = high - (((high - low) * (maxs - rawpoints)) / rng)
  20.  
  21. """
  22. scaled points ->
  23. [[ 26., 0., 0., ],
  24. [ 0., 100., 100., ],
  25. [ 100., 40., 87.5,]]
  26. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement