fork download
  1. import numpy as np
  2. import time
  3.  
  4. REPS = 200
  5.  
  6. s = np.ones(500).reshape(25,20)
  7.  
  8. t = time.time()
  9. for i in range(REPS):
  10. for j in range(s.shape[1]):
  11. min(s[:,j])
  12. print("builtin min: %.3f seconds" % (time.time() - t))
  13.  
  14. t = time.time()
  15. for i in range(REPS):
  16. for j in range(s.shape[1]):
  17. np.min(s[:,j])
  18. print("numpy min: %.3f seconds" % (time.time() - t))
Success #stdin #stdout 0.28s 27248KB
stdin
Standard input is empty
stdout
builtin min: 0.033 seconds
numpy   min: 0.046 seconds