[Python] How do I display a full expression in sympy?

Discussão em 'Python' iniciado por Stack, Março 28, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to use SymPy in a Jupyter notebook to document and perform a series of mathematical calculations in a reproducible way.

    If I define the following:

    from sympy import *

    init_printing()
    x, y, z = symbols("x y z")

    x=y+z
    x


    then I can display the value of x (that is, y+z).

    How do I display the full equation (x=y+z)?

    Running Eq(x,y+z), even with evaluate=False) returns the expression with the value of x substituted (y+z=y+z).

    Continue reading...

Compartilhe esta Página