Using expression in output cell from Jupyter


Using Sympy, I solved a parametric equation in Jupyter and got output cell of the form: { (a+b)/c }

This is just an intermediate step, and I’d like to use this formula in subsequent input cells. But I am unable to copy it in the clipboad, nor assign it to some variable.

Of course, mine expression is much more bulky than above, so it’s defeats the purpose if I type it manually.

Would be grateful for any help.



You can use ans to get the last computed value in an interactive session (such as Jupyter/IJulia).

That said, why can’t you assign your sympy call to a variable ?

1 Like


I can type ans in Input Cell in Jupyter notebook, and that indeed gives me the last expression.

But if I try putting smth like “ans+a” or “ans^2” in an input cell, I got an extremely long error message - please

see attached screenshot



That is a set. Try collecting the elements before manipulating. I think “elements” should work.