How to fix up positional arguments error?

asked 2021-10-27 01:37:02 +0200

Siz gravatar image

updated 2021-10-27 15:09:38 +0200

slelievre gravatar image

On Jupyter

TypeError: norm() takes 1 positional argument but 3 were given

I have this code.

plot((norm(x, 0, 1), 0.0625*(3+x)^2), (x, -2, 2), ymin=0)

It works but as soon as I change it to

plot((norm(x, 0, 1), 0.0625*(3+x)^2), (x, -3, -1), ymin=0)

to improve accuracy, it stops working.

edit retag flag offensive close merge delete

Comments

Neither code works in a fresh SageMath session, because the built-in function norm takes only one positional argument. You should check where your own norm function is defined, and ensure that your definition is used in both cases.

rburing gravatar imagerburing ( 2021-10-27 19:35:44 +0200 )edit