# Coding and running a notebook #

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:

<!-- <ol> -->

1.  Open the notebook in edit mode: click the edit icon (![Edit icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/pencil-icon.png))\. If the notebook is locked, you might be able to [unlock and edit](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/manage-assets.html#editassets) it\.
2.  If the notebook is marked as being *untrusted*, tell the Jupyter service to trust your notebook content and allow executing all cells by:
    
    <!-- <ol> -->
    
    1.  Clicking **Not Trusted** in the upper right corner of the notebook.
    2.  Clicking **Trust** to execute all cells.
    
    <!-- </ol> -->
    
3.  Determine if the environment template that is associated with the notebook has the correct hardware size for the anticipated analysis processing throughput\.
    
    <!-- <ol> -->
    
    1.  Check the size of the environment by clicking the View notebook info icon (![Edit icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/images/info_panel.png)) from the notebook toolbar and selecting the **Environments** page.
    2.  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](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/create-customize-env-definition.html).
        
        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](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/customize-envs.html) for Python and R.
    
    <!-- </ol> -->
    
4.  Import preinstalled libraries\. See [Libraries and scripts for notebooks](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/libraries.html)\.
5.  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](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/load-and-access-data.html)\.
6.  Prepare and analyze the data with the appropriate methods:
    
    <!-- <ul> -->
    
     *  [Build Watson Machine Learning models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-overview.html)
     *  [Build Decision Optimization models](https://dataplatform.cloud.ibm.com/docs/content/DO/DOWS-Cloud_home.html)
     *  [Use Watson Natural Language Processing](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp.html)
     *  [Use SPSS predictive analytics algorithms](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/spss-algorithms.html)
     *  [Use geospatial location analysis methods](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/geo-spatial-lib.html)
     *  [Use Data skipping for Spark SQL](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/data-skipping-spark-sql.html)
     *  [Apply Parquet encryption](https://dataplatform.cloud.ibm.com/docs/content/wsj/spark/parquet-encryption.html)
     *  [Use Time series analysis methods](https://dataplatform.cloud.ibm.com/docs/content/wsj/spark/time-series-lib.html)
    
    <!-- </ul> -->
    
7.  If necessary, schedule the notebook to run at a regular time\. See [Schedule a notebook](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/create-job-nb-editor.html)\.
    
    <!-- <ol> -->
    
    1.  Monitor the status of your job runs from the project's **Jobs** page.
    2.  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.
    
    <!-- </ol> -->
    
8.  When you're not actively working on the notebook, click **File > Stop Kernel** to stop the notebook kernel and free up resources\.
9.  Stop the active runtime (and unnecessary capacity unit consumption) if no other notebook kernels are active under **Tool runtimes** on the **Environments** page on the **Manage** tab of your project\.

<!-- </ol> -->

Video disclaimer: Some minor steps and graphical elements in these videos may differ from your deployment\.

Watch this short video to see how to create a Jupyter notebook and custom environment\.

This video provides a visual method to learn the concepts and tasks in this documentation\.

Watch this short video to see how to run basic SQL queries on Db2 Warehouse data in a Python notebook\.

This video provides a visual method to learn the concepts and tasks in this documentation\.

## Learn more ##

<!-- <ul> -->

 *  [Markdown cheatsheet](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/markd-jupyter.html)
 *  [Notebook interface](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/parts-of-a-notebook.html)

<!-- </ul> -->

<!-- <ul> -->

 *  [Stop active runtimes](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/manage-envs-new.html#stop-active-runtimes)
 *  [Load and access data](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/load-and-access-data.html)
 *  [Schedule a notebook](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/create-job-nb-editor.html)

<!-- </ul> -->

**Parent topic:**[Jupyter Notebook editor](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/notebook-editor.html)

<!-- </article "role="article" "> -->