👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.

How to create an NumPy array from a list?

The best way to create a NumPy array from a list is to use the method numpy.array(), here is an example:

>>> import numpy as np
>>> list = [[1, 2], [3, 4], [5, 6]]
>>> a = np.array(list)
array([[1, 2],
       [3, 4],
       [5, 6]])

More