In NumPy, how can you efficiently make a 1-D object into a 2-D object where the singleton dimension is inferred from the current object (i.e. a list should go to either a 1x
import numpy as np a = np.random.random(10) sel = np.at_least2d(a)[idx]