Answers for "how to convert numpy array into list"

12

ndarray to list

a = np.array([1, 2])
a.tolist()
Posted by: Guest on April-06-2020
0

list of list to numpy array

>>> lists = [[1, 2], [3, 4]]
>>> np.array(lists)
array([[1, 2],
       [3, 4]])
Posted by: Guest on March-02-2021

Code answers related to "how to convert numpy array into list"

Python Answers by Framework

Browse Popular Code Answers by Language