<jupyter_start><jupyter_text><jupyter_code>import numpy as np<jupyter_output><empty_output><jupyter_text>3x + 5y = 6


7x - 5y = 9<jupyter_code>a = np.array([[3,5], [7,-5]])
b = np.array([6,9])
x = np.linalg.solve(a, b)
x<jupyter_output><empty_output><jupyter_text>x + y + z = 6


y + z = -4


2x + 5y - z = 27<jupyter_code>a = np.array([[1,1,1],[0,1,1],[2,5,-1]])
b = np.array([6,-4,27])
x = np.linalg.solve(a, b)
x<jupyter_output><empty_output><jupyter_text>x + y = 4


2x + 2y = 8<jupyter_code>a = np.array([[1,1],[2,2]])
b = np.array([4,8])
x = np.linalg.solve(a, b)
x<jupyter_output><empty_output><jupyter_text>**A singular matrix is one that is not invertible. This means that the system of equations you are trying to solve does not have a unique solution; linalg.solve can't handle this.**

[Refrence](https://stackoverflow.com/questions/13795682/numpy-error-singular-matrix:~:text=A%20singular%20matrix%20is%20one,solve%20can't%20handle%20this.)<jupyter_code>a = np.array([[1,1],[2,2]])
b = np.array([4,8])
x = np.linalg.lstsq(a, b)
x<jupyter_output>/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:3: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
  This is separate from the ipykernel package so we can avoid doing imports until
{'fraction_non_alphanumeric': 0.16088117489986647, 'fraction_numerical': 0.048731642189586116, 'mean_word_length': 5.219917012448133, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 1, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '238677', 'license': 'Apache-2.0', 'n_tokens_mistral': 644, 'n_tokens_neox': 616, 'n_words': 143, 'path': 'Linear_Algebra.ipynb', 'repo_name': 'ShaimaM/Python', 'size': '1498'}