Answer a question

Can I print the value of a variable in Markdown Cell Jupyter Notebook?

Tried Code:

value = 5.3

Markdown cell --> Value is {{ value }} 

I want that the Markdown cell should display the value of variable

SCREENSHOT

Screenshot for Code

Answers

So After going through all the links I was able to resolve the problem by referring to nbextension jupyter notebook docs : https://github.com/ipython-contrib/jupyter_contrib_nbextensions

Steps Taken:

  1. pip install jupyter_contrib_nbextensions
  2. jupyter contrib nbextension install --user
  3. jupyter nbextension enable python-markdown/main

After the above commands started a jupyter notebook and to print the value of a variable in the markdown cells works like charm!

You just have to use {{ ac_score }} within a markdown cell.

Screenshot

enter image description here

Thanks!

Logo

学AI,认准AI Studio!GPU算力,限时免费领,邀请好友解锁更多惊喜福利 >>>

更多推荐