Advertisement
Guest User

Untitled

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