Creating Array using np.array( ) :
                        The array( ) function creates a NumPy array from a Python list or tuple.

Python
import numpy as np arr = np.array([1, 2, 3, 4]) print(arr) #output [1 2 3 4] 

Python
arr = np.array([[1, 2, 3], [4, 5, 6]]) print(arr) #output [[1 2 3] [4 5 6]] 


Creating Array using np.arange( ) :
The arange( ) function creates an array with values in a given range.

Syntax :
Python
np.arange(start, stop, step) 
Example :
Python
import numpy as np arr = np.arange(1, 10, 2) print(arr) #output [1 3 5 7 9] 

Creating Array using np.linspace( ) :
The linspace( ) function creates evenly spaced numbers between two values.

Syntax :
Python
np.linspace(start, stop, num) 

Example :
Python
arr = np.linspace(1, 5, 5) print(arr) #output [1. 2. 3. 4. 5.] 

Creating Array of Zeros :
Python
arr = np.zeros(5) print(arr) #output [0. 0. 0. 0. 0.] 


Creating Array of Ones :

Python
arr = np.ones(5) print(arr) #output [1. 1. 1. 1. 1.] 

Creating Empty Array :
Python
arr = np.empty(4) print(arr)