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
  • 2,063
  • 2
  • 20
  • 27
David Montgomery
  • 473
  • 1
  • 4
  • 15

0 Answers0