0 / 0
Hiding sensitive code cells in a notebook
Last updated: Oct 09, 2024
Hiding sensitive code cells in a notebook

If your notebook includes code cells with sensitive data, such as credentials for data sources, you can hide those code cells from anyone you share your notebook with. Any collaborators in the same project can see the cells, but when you share a notebook with a link, those cells will be hidden from anyone who uses the link.

To hide code cells:

  1. Open the notebook and select the code cell to hide.

  2. Insert a comment with the hide tag on the first line of the code cell.

    For the Python and R languages, enter the following syntax: # @hidden_cell

    Syntax for hiding code cells

Parent topic: Sharing notebooks

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more