[IPython-User] Is it possible to join math expressions with display()

Joon Ro joonpyro@gmail....
Mon Mar 26 19:47:39 CDT 2012


Thank you very much! That was exactly what I was looking for.

Best,
Joon

On Sun, 25 Mar 2012 20:16:02 -0500, Aaron Meurer <asmeurer@gmail.com>  
wrote:

> On Sun, Mar 25, 2012 at 6:55 PM, Ronan Lamy <ronan.lamy@gmail.com> wrote:
>> Le dimanche 25 mars 2012 à 13:19 -0500, Joon Ro a écrit :
>>> Hi,
>>>
>>> I was wondering if it is possible to join math expressions with  
>>> display()
>>> in ipython notebook.
>>> For example, after solving the following:
>>>
>>>      x_sol = solve(x +y - 3, x)[0]
>>>
>>> If I just do display(x_sol), then notebook will print out the solution
>>> (-y+3). Is there any way to print it prettier, e.g. I get something  
>>> like:
>>>
>>>      x = - y + 3
>>>
>>> with display()? If I just do display(x, Symbol('='), x_sol) then it  
>>> will
>>> print them in separate lines.
>>
>> I guess you're using sympy. The best way to achieve what you want is to
>> build a sympy object that prints the way you like. In this case, Eq(x,
>> x_sol) is probably what you need. You don't even need to call display(),
>> the notebook pretty-prints it automatically.
>
> That's only if you started the notebook with --profile=sympy.
>
> Aaron Meurer
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the IPython-User mailing list