how to convert numpy array into list in python code example
Example 1: ndarray to list
a = np.array([1, 2])
a.tolist()
Example 2: list of list to numpy array
>>> lists = [[1, 2], [3, 4]]
>>> np.array(lists)
array([[1, 2],
[3, 4]])
a = np.array([1, 2])
a.tolist()
>>> lists = [[1, 2], [3, 4]]
>>> np.array(lists)
array([[1, 2],
[3, 4]])