Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- lookup = np.array([7, 10, 1, 4, 1, 7, 9, 3, 5, 6])
- indices = np.array([0, 1, 0, 0, 1])
- real_indices = np.arange(0, 2 * indices.size, 2) + indices
- s = lookup[real_indices].sum()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement