1# importing library
2import numpy
3
4# initilizing list
5lst = [1, 7, 0, 6, 2, 5, 6]
6
7# converting list to array
8arr = numpy.array(lst)
9
10# displaying list
11print ("List: ", lst)
12
13# displaying array
14print ("Array: ", arr)
1import numpy as np
2
3# 1d array to list
4arr = np.array([1, 2, 3])
5print(f'NumPy Array:\n{arr}')
6#NumPy Array: [1 2 3]
7
8list1 = arr.tolist()
9print(f'List: {list1}')
10#List: [1, 2, 3]