Vaishnav
Vaishnav

Reputation: 81

How to hide Code in Jupyter Notebook w/ VS Code?

I'm using VS Code to write Jupyter notebook as I feel more comfortable with it. I found out that there is no option to edit meta data of the cells in order to hide only select code cells. I also came across some answers suggesting to use # @hidden_cell in the code cell but that doesn't work or am I doing it wrong? not much information was available for this. I tried using the command

jupyter nbconvert my_notebook.ipynb --no-input --to pdf

and that works fine but it removes all the code. I wish to remove only specific code cells.

Upvotes: 8

Views: 7975

Answers (1)

Siwan SR
Siwan SR

Reputation: 19

You can use .env to hide the code.

hidden_code = (code)

Then use the variable hidden_code inside brackets to use it.

Upvotes: 1

Related Questions