Is there a straightforward way to generate two numpy arrays from one based on one logical test?
import numpy as np
x = np.array([1,2,3,4,5,6,7,8])
y = x[x%2==0]
z = x[x%2==1]
I don't want to perform the second test for z. Obviously z is simply x with elements from y removed. Can I simply extract z from x with the help of y? Thanks for your help.