0 / 0
Hiding sensitive code cells in a notebook

Hiding sensitive code cells in a notebook

Hide code cells that contain sensitive data, such as credentials for data sources.

Note: When you share a notebook with a link, only collaborators with Editor or Admin role can see the content of code cells that were marked as sensitive. Collaborators with Viewer role can't see this content.

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