Learn practical skills, build real-world projects, and advance your career
!pip install jovian --upgrade --quiet
import numpy as np
import matplotlib.pyplot as plt
a= np.arange(0,2*np.pi,0.001)
x= 2*np.cos(a)
y= 2*np.sin(a)
plt.axis('equal')
plt.plot(x,y)
plt.show()
Notebook Image
import sympy
from sympy import*
A= Matrix([[1,1,0],[2,2,0],[1,0,0]])
print("Matrix:{}".format(A))
A_rref, x=A.rref()
print("The row reduced echelon form of matrix:{}".format(A_rref))
Matrix:Matrix([[1, 1, 0], [2, 2, 0], [1, 0, 0]]) The row reduced echelon form of matrix:Matrix([[1, 0, 0], [0, 1, 0], [0, 0, 0]])
import numpy
from numpy import linalg as LA
A= np.array([[1,0,1],[0,1,3],[0,0,1]])
det= LA.det(A)
print("Determinant is= "+ format(det))
if det==0:
    print('Inverse doesnt exist for the above matrix')
else:
    invA= LA.inv(A)
    print('Inverse of the matrix is: \n'+ format(invA))
eval, evec= LA.eig(A)
print('Eigen values are:' + format(eval))
print('Eigenvectors are :\n' + format(evec))
    
Determinant is= 1.0 Inverse of the matrix is: [[ 1. 0. -1.] [ 0. 1. -3.] [ 0. 0. 1.]] Eigen values are: [1. 1. 1.] Eigenvectors are : [[ 1.00000000e+00 0.00000000e+00 -3.16227766e-01] [ 0.00000000e+00 1.00000000e+00 -9.48683298e-01] [ 0.00000000e+00 0.00000000e+00 7.02166694e-17]]
jovian.commit()
[jovian] Attempting to save notebook..