Report Bug

QusHow we can convert the Numpy array to the list in python? Qusहम पायथन में Numpy ऐरे को सूची में कैसे बदल सकते हैं?


A. list(array)
B. list.array
C. array.list
D. None of these


Solution
A. list(array)



Explanation
import numpy as np
numpy_array = np.array([1, 2, 3, 4, 5]) # Creating a NumPy arrays
lst=list(numpy_array) # conver numpay array to list
print(type(lst)) # <class 'list'>


You can also convert a NumPy array to a Python list using the tolist() method of the NumPy array.

array_anme.tolist()

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad