How to convert list to Numpy array? - Pythoneo
pythoneo.com › how-to-convert-list-to-numpy-arrayNov 28, 2021 · To convert list of lists to Numpy array you need to use Python concatenate method. The parameter you need to use to cast it properly is axis=0. import numpy as np my_list = [ [1, 2, 3], [4, 5], [6, 7, 8, 9]] my_array = np.concatenate (my_list, axis=0) print (f"Numpy array converted " f"from Python list of lists: {my_list}")