Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert variables into a text cell using google colab

I would like to insert a python variable into a text cell, in google colab.

For example, if a=10, I would like to insert the a into a text cell and render the value.

So in the text cell (using Jupyter Notebook with nbextensions) I would like to write the following in the text cell: There will be {{ a }} pieces of fruit at the reception.

It should show up as: There will be 10 pieces of fruit at the reception.

The markdown cheatsheets and explanations do not say how to achieve this. Is this possible currently?

like image 859
Nicolas Avatar asked Aug 23 '19 04:08

Nicolas


1 Answers

It's not possible to change 'input cell' (either code or markdown) programmatically. You can change only the output cells. Input cells always require manually change. (even %load doesn't work)

like image 92
korakot Avatar answered Sep 17 '22 11:09

korakot