Coding and running a notebook
After you create a notebook, you’re ready to start writing and running code to analyze data.
A notebook runs in a Jupyter kernel in the environment that you specified at the time you created the notebook. If the environment is a standard default environment and you select this environment for more than one notebook, multiple notebook kernels are started in the same runtime. If the environment is a Spark environment, the kernel is started in a dedicated Spark runtime.
To open a notebook in edit mode, click the edit icon (). If the notebook is locked, you might be able to unlock and edit it.
To tell the service to trust your notebook content and execute all cells:
- Click Not Trusted in the upper right corner of the notebook.
- Click Trust to execute all cells.
To develop analytic applications in a notebook, follow these general steps:
- Import preinstalled libraries or add your own libraries to your environment:
- Load and access data. See Load and access data. Alternatively, to access project assets programmatically, see:
- Prepare and analyze the data with the appropriate methods:
- Collaborate with other project members. You can add comments to notebooks by clicking the comment icon ().
- If necessary, schedule the notebook to run at a regular time.See Schedule a notebook.
- When you’re not actively working on the notebook, click File > Stop Kernel to stop the notebook kernel and free up resources.
Watch this short video to see how to create a Jupyter notebook and custom environment.
Watch this video to see how to run basic SQL queries on Db2 Warehouse on Cloud data in a Scala notebook.
Find videos showing additional examples of Scala and Python notebooks on the Videos page