SHARE
TWEET

Untitled

a guest Mar 20th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import timeit
  3.  
  4. arrs = []
  5. for _ in range(1000):
  6.     arrs.append(np.random.randint(-5, 5, 10))
  7.  
  8.  
  9. def func1():
  10.     for arr in arrs:
  11.         zero_els = len(arr) - np.count_nonzero(arr)
  12.  
  13.  
  14. print(timeit.timeit(func1, number=10))
RAW Paste Data
Top