How to create a Numpy 1D array in Python?

One-dimensional array contains elements only in one dimension. In other words, the shape of the NumPy array should contain only one value in the tuple. Let us see how to create 1 dimensional NumPy arrays. In the lecture you will also learn to check the size of the array.

Example:

# importing the module import numpy as np 

 creating the list list = [100, 200, 300, 400] 

 creating 1-d array n = np.array(list) print(n)

Output:

[100 200 300 400]