Write a NumPy program to convert a NumPy array into Python list structure.
import numpy as np x= np.arange(6).reshape(3, 2) print("Original array elements:") print(x) print("Array to list:") print(x.tolist())
Sample Output:
Original array elements: [[0 1] [2 3] [4 5]] Array to list: [[0, 1], [2, 3], [4, 5]]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer