IBM Cloud Pak® for Data Version 4.6 will reach end of support (EOS) on 31 July, 2025. For more information, see the Discontinuance of service announcement for IBM Cloud Pak for Data Version 4.X.
Upgrade to IBM Software Hub Version 5.1 before IBM Cloud Pak for Data Version 4.6 reaches end of support. For more information, see Upgrading IBM Software Hub in the IBM Software Hub Version 5.1 documentation.
Coding and running a notebook (Watson Studio)
After you created a notebook to use in the notebook editor, you need to add libraries, code, and data so you can do your analysis.
To develop analytic applications in a notebook, follow these general steps:
-
Open the notebook in edit mode, click the edit icon (
). If the notebook is locked, you might be able to unlock and edit it. -
If the notebook is marked as being untrusted, tell the Jupyter service to trust your notebook content and allow executing all cells by:
- Clicking Not Trusted in the upper right corner of the notebook.
- Clicking Trust to execute all cells.
-
Determine if the environment template that is associated with the notebook has the correct hardware size for the anticipated analysis processing throughput.
-
Check the size of the environment by clicking the View notebook info icon (
) from the notebook toolbar and
selecting the Environments page. -
If you need to change the environment, select another one from the list or, if none fits your needs, create your own environment template. See Creating emvironment template.
If you create an environment template, you can add your own libraries to the template that are preinstalled at the time the environment is started. See Customize your environment for Python and R.
-
-
Import preinstalled libraries. See Libraries and scripts for notebooks.
-
Load and access data. You can access data from project assets by running code that is generated for you when you select the asset or programmatically by using preinstalled library functions. See Load and access data.
-
Prepare and analyze the data with the appropriate methods:
-
If necessary, schedule the notebook to run at a regular time. See Schedule a notebook job.
- Monitor the status of your job runs from the project's Jobs page.
- Click your job to open the job's details page to view the runs for your job and the status of each run. If a run failed, you can select the run and view the log tail or download the entire log file to troubleshoot the run.
-
When you're not actively working on the notebook, click File > Stop Kernel to stop the notebook kernel and free up resources.
If you accidentally close your notebook browser window while the notebook is still running, or are logged out by the system if your job runs very long, the kernel will remain active. When you reopen the same notebook, the notebook is connected to the same kernel and all output cells are retained. The execution progress of a notebook can only be restored for notebooks that run in a local kernel. If your notebook runs in a Spark or Hadoop cluster, all notebook changes that were not saved before you left the notebook or closed the web browser window will be lost.
Watch this video to see how to code and run a notebook to visualize and analyze precipitation data from the UNData portal.
This video provides a visual method as an alternative to following the written steps in this documentation.
Learn more
Parent topic: Notebooks