Ask Your Question


asked 2018-12-04 16:28:23 +0200

thetha gravatar image

updated 2019-03-16 08:24:34 +0200

FrédéricC gravatar image

from sympy.solvers import solve

from sympy import Symbol

x = Symbol('x')


How its possible to use numerical_approx() on this this solutions is not working,



also not

edit retag flag offensive close merge delete


To display blocks of code or error messages, skip a line above and below, and do one of the following (all give the same result):

  • indent all code lines with 4 spaces
  • select all code lines and click the "code" button (the icon with '101 010')
  • select all code lines and hit ctrl-K

For instance, typing

If we define `f` by

    def f(x, y, z):
        return x * y * z

then `f(2, 3, 5)` returns `30` but `f(2*3*5)` gives:

    TypeError: f() takes exactly 3 arguments (1 given)


If we define f by

def f(x, y, z):
    return x * y * z

then f(2, 3, 5) returns 30 but f(2*3*5) gives:

TypeError: f() takes exactly 3 arguments (1 given)

Please edit your question to do that.

slelievre gravatar imageslelievre ( 2018-12-04 18:22:12 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-12-04 17:34:20 +0200

rburing gravatar image

updated 2018-12-04 17:34:55 +0200

Sage's and SymPy's expressions and numbers have different types, but you can convert between them as explained in A Sample Session using SymPy.

In your case:

sage: C[0]._sage_().numerical_approx()
sage: numerical_approx(C[0]._sage_())
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-12-04 16:28:23 +0200

Seen: 662 times

Last updated: Dec 04 '18