Write short note on following:
a) How to create One-dimensional array?
b) How to identify datatype for numpy array?
1)
import numpy as np
lst = [10, 22, 40, 56]
# creating one dimensional array
n = np.array(lst)
print(n)
2)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print('Datatype:', arr.dtype)
Comments
Leave a comment