Search code examples
jupyter-notebookipython

Can I use variables on an IPython notebook markup cell?


I have an IPython notebook and I would like to use one of my variables inside a markup cell. Is this even possible? If so, how do you do it?


Solution

  • Currently, this is not possible, however there is a large discussion on this topic here https://github.com/ipython/ipython/pull/2592. The PR is currently closed, but a corresponding issue is opened https://github.com/ipython/ipython/issues/2958 and marked as wishlist.

    Update

    In the meantime an IPython extension has appeared which allows to render python variables in markdown cells. This extension is part of the IPython notebook extensions and works with IPython 2.x and 3.x. For a detailed description see the wiki page.