Published on January 26, 2024By DeveloperBreeze
Python Example: Creating a 1D Array with NumPy
The following Python code demonstrates how to create a one-dimensional array using NumPy:
import numpy as np
# Create a 1D array
arr = np.array([1, 2, 3, 4, 5])
print(arr)
Comments
Please log in to leave a comment.