X = np.random.randint(0, 99, (6, 5))
m, n = X.shape
a = np.in1d(np.arange(m), np.random.randint(0, m, m))
b = np.in1d(np.arange(n), np.random.randint(0, n, n))
X[(a), :][:, (b)]
X[np.ix_(a, b)]
Shorter version of this numpy array indexing