how to create a numpy array from a list code example Example: numpy array from list >>> a = [1, 2] >>> np.asarray(a) array([1, 2])