Create an array from values
Write a NumPy program to create an array with the values 10, 34, 86, 26, 56.
[10 34 86 26 56] int64
Approach
np.array(list).
Solution
import numpy as nparr = np.array([10, 34, 86, 26, 56])print(arr, arr.dtype)[10 34 86 26 56] int64
Learn the concept
New to this topic? Read the lesson, then come back.