Numpy Library of Python
Numpy - Numerical Python.
Import Numpy
import numpy as np Where np represents alternative name for numpy library.
Import Numpy
import numpy as np Where np represents alternative name for numpy library.
Create a 1-D Array
#1-d array
import numpy as np
a=np.array([1,2,3])
print("1-Dimensional Array",a)
Create a 2-D Array
#2-d array
import numpy as np
a=np.array([[1,2,3],[4,5,6]])
print("2-Dimensional Array",a)
Create array using range function
#create array using range function
import numpy as np
a=np.arange(6)
print("Array Using Range Function",a)
0 Comments