In a Jupyter notebook, when using
1 import sympy as sym, numpy as np
2 q = sym.Symbol('q')
3 print(np.power(q,2))
4 np.power(q,2)
the output is
q**2
[Out 1]: <sup>2</sup>
i.e., the (last) output is displayed with pretty math (as 2 actually, but I could not produce this above due to the code formatting), while the output of print
commands is displayed with pure text.
This difference is much more noticeable when displaying fractions, square roots, etc.
Is there any way to force the output of a print
command to show "pretty", the same as the result of the last line in the cell?