Making efficient array selections in NumPy