How to pretty print in ipython notebook via sympy?

后端 未结 4 1997
迷失自我
迷失自我 2020-12-05 03:57

I tried pprint, print, the former only prints Unicode version, and the latter doesn\'t do pretty prints.

from sympy import symbols         


        
4条回答
  •  一个人的身影
    2020-12-05 04:35

    you need to use display:

    from IPython.display import display
    
    display(yourobject)
    

    It will choose the appropriate representation (text/LaTex/png...), in recent enough version of IPython (6.0+) display is imported by default, still we recommend to explicitly import it.

提交回复
热议问题