I can't solve the simultaneous equation in Python.

Asked 1 years ago, Updated 1 years ago, 248 views

I solved the simultaneous equation and entered the following and ran it, but I couldn't say anything at all.
What's wrong?

 from numpy.linalg import solve
left = [[2,1],
        [1, 3]]

right = [1,13]

print(solve(left, right))

Additional
> This site Online Python Compiler (Interpreter) - Programiz
It certainly worked well on the site you suggested.
What should I answer about environmental information?

The result of trying the above source code using Jupiter called by anaconda is the question.

python numpy

2022-12-24 22:03

1 Answers

If you update the package, it might work.

$conda activate base

$ conda update conda
$ conda update --all

$ conda list numpy
# Name Version Build Channel
numpy1.21.5py39h6c91a56_3
numpy-base 1.21.5py39ha15fc14_3
numpydoc 1.5.0 py39h06a4308_0
$ conda list jupyter
# Name Version Build Channel
jupyter1.0.0py39h06a4308_8
jupyter_client 7.4.8py39h06a4308_0
jupyter_console 6.4.4py39h06a4308_0
jupyter_core 4.11.2py39h06a4308_0
jupyter_server1.23.4py39h06a4308_0
jupyterlab 3.5.0 py39h06a4308_0
jupyterlab_pygments 0.1.2py_0
jupyterlab_server2.10.3pyhd3b1b0_1
jupyterlab_widgets 1.0.0 pyhd3b1b0_1

However,
If you use non-Anaconda official packages such as conda-forge repository, you may have trouble.Recently, the ipywidgets system did not work on conda-forge (not displayed, the operation is strange) etc. (about a week)

  • You should keep your base environment untouched
    If you want to add packages, activate conda-forge repository, etc., create a new environment and do so
  • If there is a problem, it may work if you check it in the base environment

You can also use JupyterLite to verify operation on JupiterLab (like moving lightly).Python & NumPy (or others) running in a web browser


2022-12-24 23:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.