KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Write a Python program to demonstrate the use of the SciPy library.

Python Modules

1 Like

Answer

import numpy as np
from scipy.linalg import solve
coefficients = np.array([[1, 2], [2, 2]])
constants = np.array([1, -1])
solution = solve(coefficients, constants)
X = solution[0]
Y = solution[1]
print("X =", X)
print("Y =", Y)

Output

X = -2.0
Y = 1.5

Answered By

1 Like


Related Questions