Allosteric
Allosteric

Reputation: 960

Using Output In markdown Jupyter notebook

I am using Jupyter Notebook to write my report and it would be convenient to include an output in my markdown.

The question below is a simillar question. Jupyter notebook output in markdown

For example, I have a code cell with the code

In[1]: import random
       a = random.randint(1,4);a

and the output was

Out[1]: 2

in my report, I would realy like to include this output just like

'the chosen number was 2'

however, as the 2 is a random number, it would be very convenient to have a way to include the variation a in my markdown like;

'the chosen number was %a'

kind of way.

Is there any way to achieve this?

Upvotes: 1

Views: 2792

Answers (1)

Louise Davies
Louise Davies

Reputation: 15981

It's not possible in the main notebook yet (although there are discussions about it) but there is an extension which should suit your purposes:

http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/python-markdown/readme.html

It's contained within the ipython-contrib-extensions package, for which the install instructions are here: http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html

Upvotes: 2

Related Questions