Q:

Write a NumPy program to convert a given list into an array, then again convert it into a list. Check initial list and final list are equal or not

0

Write a NumPy program to convert a given list into an array, then again convert it into a list. Check initial list and final list are equal or not

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
a = [[1, 2], [3, 4]]
x = np.array(a)
a2 = x.tolist()
print(a == a2)

Sample Output:

True

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now