Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import numpy as np
  2. H = [12,12,5,32,6,0.5]
  3. P=H.max()
  4. S=[22, 33, 45.6, 21.6, 51.8]
  5. SP = P*np.array(S)
  6.  
  7. import numpy as np
  8. H = [12,12,5,32,6,0.5]
  9. S=[22, 33, 45.6, 21.6, 51.8]
  10. SP = H.max()*np.array(S)
  11.  
  12. In [74]:
  13.  
  14. import numpy as np
  15. H = np.random.random(100000)
  16. %timeit P=H.max()
  17. S=np.random.random(100000)
  18. %timeit SP = P*np.array(S)
  19. %timeit SP = H.max()*np.array(S)
  20. 10000 loops, best of 3: 51.2 µs per loop
  21. 10000 loops, best of 3: 165 µs per loop
  22. 1000 loops, best of 3: 217 µs per loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement