as numpy array code example
Example 1: numpy array from list
>>> a = [1, 2]
>>> np.asarray(a)
array([1, 2])
Example 2: np list to np
import numpy as np
a = np.array( [[2,3,4], [3,4,5]] )
>>> a = [1, 2]
>>> np.asarray(a)
array([1, 2])
import numpy as np
a = np.array( [[2,3,4], [3,4,5]] )