Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = np.array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])
- b = np.array([0,5,10,15])
- out = np.array([5, 10, 15]
- out = []
- for x in b:
- i = np.argmax(a>=x)
- out.append(i)
- out = []
- i=0
- for x in b:
- i = np.argmax(a[i:]>=x)+i
- out.append(i)
Add Comment
Please, Sign In to add comment