daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = np.array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])
  2. b = np.array([0,5,10,15])
  3.    
  4. out = np.array([5, 10, 15]
  5.    
  6. out = []
  7. for x in b:
  8.     i = np.argmax(a>=x)
  9.     out.append(i)
  10.    
  11. out = []
  12. i=0
  13. for x in b:
  14.     i = np.argmax(a[i:]>=x)+i
  15.     out.append(i)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top