0

I am having this very annoying problem that I know there is a nice solution to, but can't figure out:

import numpy as np

a = np.arange(10)
i_want_these_idxs = np.array([5,6,7,8,9])
except_for_these = np.array([7,8])
arr = a[???]
# arr should be np.array([5,6,8,9])

Any ideas?

ack
  • 1,870
  • 1
  • 17
  • 22
David Montgomery
  • 463
  • 4
  • 14

0 Answers0