Ask Your Question


asked 2018-12-04 09:28:23 -0600

thetha gravatar image

updated 2018-12-10 01:55:17 -0600

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 11:22:12 -0600 )edit

1 answer

Sort by » oldest newest most voted

answered 2018-12-04 10:34:20 -0600

updated 2018-12-04 10:34:55 -0600

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 09:28:23 -0600

Seen: 67 times

Last updated: Dec 04