<jupyter_start><jupyter_text>Vector Spaces and Its Operations<jupyter_code>import numpy as np
A = np.array([4,3])
B = np.array([2,-5])

print('Vector A is', A)
print('Vector B is', B)
import numpy as np
ball1 = np.array ([1,2,3])
ball2 = np.array ([0,1,-1])
pool = np.array ([ball1,ball2])
pool.shape
import numpy as np
ball1 = np.array ([1,2,3])
ball2 = np.array ([0,1,-1])
pool = np.array ([ball1,ball2])
print(pool.shape)
print(pool.size)
import numpy as np
ball1 = np.array ([1,2,3])
ball2 = np.array ([0,1,-1])
pool = np.array ([ball1,ball2])
pool.shape
pool.ndim
U = np.array ([[1,2,3,],[4,5,6]])
U
U = np.array ([[1,2,3,],[4,5,6]])
U.shape
U = np.array ([[1,2,3,],[4,5,6]])
U.ndim
U = np.array ([[1,2,3,],[4,5,6]])
U.size
U = np.array ([[1,2,3,],[4,5,6]])
U
U.size<jupyter_output><empty_output><jupyter_text>Addition of Vectors<jupyter_code>R = A+B
print(R)
R = np.add(A,B)
R<jupyter_output><empty_output><jupyter_text>Vector Subraction<jupyter_code>R = np.subtract(A,B)
R<jupyter_output><empty_output><jupyter_text>Vector Scaling<jupyter_code>A = np.array([1,5,8,9])
S = 5*A
S

A = np.array([1,5,8,9])
S = np.multiply(5,A)
S<jupyter_output><empty_output><jupyter_text>Vector Cross Product<jupyter_code>#initialize arrays
A = np.array([2,3,4])
B = np.array([1,7,0])

#compute cross product
output = np.cross(A,B)
print(output)
#compute the dot product of A and B
output = np.dot(A,B)
print(output)<jupyter_output>23
StarcoderdataJupyterStructuredCleanDedup