After you set up a project and configured the environment, you can create a notebook file, copy a sample notebook from the Gallery, or add a notebook from a catalog. You must have the Admin or Editor role in the project to create a notebook.
Watch this short video to learn the basics of Jupyter notebooks.
Create a notebook file
To create a notebook file in the project:
- From your project, click Add to Project > Notebook.
- On the New Notebook page, specify the method to use to create your notebook. You can create a blank notebook, upload a notebook file from your file system, or upload a notebook file from a URL. The notebook you select to upload must be a .ipynb file. The URL must be a public URL that is shareable and doesn’t require authentication.
- Specify the runtime environment for the language you want to use (Python, R, or Scala). You can select a preset environment definition or an environment definition which you created and configured from the Environments page of your project.
Click Create Notebook. The notebook opens in edit mode and is locked by you. Locking the file avoids possible merge conflicts that might be caused by competing changes to the file. To get familiar with the structure of a notebook, see Parts of a notebook.
Note that the time that it takes to create a new notebook or to open an existing one for editing might vary. If no runtime container is available, a container needs to be created and only after it is available, the Jupyter notebook user interface can be loaded. The time it takes to create a container depends on the cluster load and size. Once a runtime container exists, subsequent calls to open notebooks will be significantly faster.
Copy a sample notebook from the Gallery
Sample notebooks from the Gallery are based on real-world scenarios and contain many useful examples of computations and visualizations that you can adapt to your analysis needs.
To copy a sample notebook:
- In the Watson Studio menu, click Gallery, then filter for Notebooks to show only notebook cards.
- Find the card for the sample notebook you want and click the card. You can view the notebook contents to browse the steps and the code that it contains.
- To work with a copy of the sample notebook, click the Copy icon (). The New Notebook screen opens.
- Choose the project for the notebook.
- Specify the runtime environment. If you created an environment definition on the Environments page of your project, it will appear in the list of runtimes you can select from.
- Click Create Notebook. The notebook opens in edit mode and is locked by you. Locking the file avoids possible merge conflicts that might be caused by competing changes to the file. To get familiar with the structure of a notebook, see Parts of a notebook.
- Notebook locking
- Use default CPU environments
- Use Spark environments
- Change the environment runtime used by a notebook
Watch these videos to see how to run a sample notebook from the Gallery.