list to numpy import numpy as np a = [1,2] b = np.array(a) print("a:", type(a)) print("b:", type(b)) numpy to list import numpy as np a = np.zeros((2,1)) b = a.tolist() print("a:", type(a)) print("b:", type(b))