Guest User

Untitled

a guest
Jan 22nd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  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)
Add Comment
Please, Sign In to add comment