<jupyter_start><jupyter_text>Experiment No 20  Solving Matrices<jupyter_code>from scipy import linalg
import numpy as np
print("Determinant of 2x2 Matrix")
a=[4,5]
b=[3,2]
print(a,b,sep="\n")
arr_2d = np.array([a,b])
linalg.det( arr_2d )
from scipy import linalg
import numpy as np
print("Determinant of 3x3 Matrix")
a=[5,3,9]
b=[0,6,4]
c=[2,8,7]
print(a,b,c,sep="\n")
arr_3d = np.array([a,b,c])
linalg.det( arr_3d )
from scipy import linalg
import numpy as np
print("Eigen values & Eigen Vectors of 2x2 matrix")
a=[7,0]
b=[2,9]
print(a,b,sep="\n")
arr_2d = np.array([a,b])
eigenValue, eigenVector = linalg.eig(arr_2d)
print("\nEigens Values: ", eigenValue)
print("\nEigens Vectors: ", eigenVector,sep="\n")
from scipy import linalg
import numpy as np
print("Eigen values & Eigen Vectors of 3x3 matrix")
a=list(map(int,input("Enter 3 values separated with space: ").split()))
b=list(map(int,input("Enter 3 values separated with space: ").split()))
c=list(map(int,input("Enter 3 values separated with space: ").split()))
print(a,b,c,sep="\n")
arr_3d = np.array([a,b,c])
eigenValue, eigenVector = linalg.eig(arr_3d)
print("\nEigens Values: ", eigenValue)
print("\nEigens Vectors: ", eigenVector,sep="\n")<jupyter_output>Eigen values & Eigen Vectors of 3x3 matrix
Enter 3 values separated with space: 7 0 0
Enter 3 values separated with space: 5 3 0
Enter 3 values separated with space: 6 1 4
[7, 0, 0]
[5, 3, 0]
[6, 1, 4]

Eigens Values:  [4.+0.j 3.+0.j 7.+0.j]

Eigens Vectors: 
[[ 0.          0.          0.34497574]
 [ 0.          0.70710678  0.43121968]
 [ 1.         -0.70710678  0.83369138]]<jupyter_text>Solve Equations  x + 3y + 5z = 10 2x + 5y + z = 8 2x + 3y + 8z = 3<jupyter_code>from scipy import linalg
import numpy as np
equation = np.array([[1,3,5],[2,5,1],[2,3,8]])
solution = np.array([[10],[8],[3]])
roots = linalg.solve(equation,solution)
print(roots)<jupyter_output>[[-9.28]
 [ 5.16]
 [ 0.76]]
{'fraction_non_alphanumeric': 0.17373103087388803, 'fraction_numerical': 0.07796964939822083, 'mean_word_length': 4.793939393939394, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '204449', 'license': 'MIT', 'n_tokens_mistral': 912, 'n_tokens_neox': 805, 'n_words': 207, 'path': 'Programming_in_Python/Jupyter Notebooks/61_Experiment No 20_Yash Purohit.ipynb', 'repo_name': 'PrasoonJain2002/Mini_Python_Projects', 'size': '1911'}