#plot a graph
import [Link] as plt
[Link]([1,2,3],[4,5,6])
[Link]("X-axis")
[Link]("Y-axis")
[Link]("Line Plot")
[Link]()
# Creating Numpy arrays:
import numpy as np
arr = [Link]([1,2,3])
print(arr)
#Array attributes:
arr = [Link]([[1,2],[3,4]])
print([Link]) #output: [2 2]
print([Link])
#Array Initialization
import numpy as np
z = [Link]((2,2))
print("Initialization with zeros:\n",z)
x = [Link]((3,3))
print("Initialization with ones:\n",x)
y = [Link](3)
print("Initialization with Identity:\n",y)
#Indexing and Slicing
import numpy as np
arr = [Link]([1,2,3,4])
print(arr[1:3])
#Array Operations:
import numpy as np
a1 = [Link]([1,2,3])
a2 = [Link]([9,10,11])
print(a1 + a2) #output: [10 12 14]
#Basic Math and Statistical Functions:
arr = [Link]([1,2,3,4])
print([Link](arr)) #10 [Link](): sum of array elements
print([Link](arr)) # 2.5
print([Link](arr)) # 1 [Link](), [Link](): Minimum and Maximum values
print([Link](arr)) # 4
#standard deviation and variance
# [Link]() method: Compute the standard deviation of the given data.
import numpy as np
arr = [2,4] # 1D array
print("std of arr : ", [Link](arr)) #std deviation of arr : 1.0
# [Link]() method: Compute the variance of the given data.
import numpy as np
arr = [2,4] # 1D array
print("std of arr : ", [Link](arr)) #std of arr : 1.0
#dot product of vectors
# [Link]() method: Returns the dot product of vectors a and b.
v1 = [1, 2]
v2 = [3, 4]
product = [Link](v1,v2)
print("Dot Product:", product) #Dot Product: 11
# [Link]() method: Find the cross product of two given vectors.
v1 = [1, 2,0]
v2 = [3, 4,0]
product = [Link](v1,v2)
print("Cross Product:", product[-1]) # Cross Product: -2
# [Link]() method: performs matrix multiplication
v1 = [1, 2]
v2 = [3, 4]
product = [Link](v1,v2)
print("Matrix multiplication:", product)