Quick start: Analyze data in a Jupyter notebook
You can create a notebook in which you run code to prepare, visualize, and analyze data, or build and train a model. Read about Jupyter notebooks, then watch a video and take a tutorial that’s suitable for users with some knowledge of Python code.
Your basic workflow includes these tasks:
- Create a project. Projects are where you can collaborate with others to work with data.
- Add your data to the project. You can add CSV files or data from a remote data source through a connection.
- Create a notebook in the project.
- Add code to the notebook to load and analyze your data.
- Run your notebook and share the results with your colleagues.
Read about notebooks
A Jupyter notebook is a web-based environment for interactive computing. You can run small pieces of code that process your data, and you can immediately view the results of your computation. Notebooks include all of the building blocks you need to work with data:
- The data
- The code computations that process the data
- Visualizations of the results
- Text and rich media to enhance understanding
Read more about notebooks
Watch a video about notebooks
Watch this video to learn the basics of Jupyter notebooks.
Video disclaimer: Some minor steps and graphical elements in this video differ from your Cloud Pak for Data deployment. This video shows the Cloud Pak for Data as a Service user interface.
This video provides a visual method as an alternative to following the written steps in this documentation.
Try a tutorial to create a notebook
In this tutorial, you will complete these tasks:
- Create a project.
- Add a notebook to your project.
- Load a file and save the notebook.
- Find and edit the notebook.
- Share read-only version of the notebook.
- Schedule a notebook to run at a different time.
This tutorial will take approximately 15 minutes to complete.
Task 1: Create a project and add an asset
You need a project to store the notebook and data asset.
- If you have an existing project, open it. If you don't have an existing project, click Create a project on the home page or click New project on your Projects page.
- Select Analytics project as the project type.
- Select Create an empty project.
- On the Create a project screen, add a name and optional description for the project.
- Click Create.
- Download the precipitation.csv file
- Add the
precipitation.csvfile to your project:
- From your project, click Add to project > Data.
- In the Load pane that opens, browse to select the
precipitation.csvfile, and click Open. Stay on the page until the load completes. The
precipitation.csvfile is added to your project as a data asset.
For more information or to watch a video, see Creating a project.
Task 2: Add a notebook to your project
Create a new notebook in your project.
- From your project's Assets page, click Add to project > Notebook.
- Type a name and description (optional).
- Select a runtime environment for this notebook.
- Click Create. Wait for the notebook editor to load.
Task 3: Load a file and save the notebook
Load data into a pandas DataFrame.
- Click the Find and add data icon.
- From the Files tab, click the Insert to code dropdown next to the data set you added, and insert the
- Click Run to run your code. The first few rows of your data set will display.
- To save a version of your notebook, click File > Save Version. You can also just save your notebook with File > Save.
Task 4: Find and edit the notebook
Locate the saved notebook on the Assets tab, and edit the notebook.
- Return to your project to find your notebook on the Assets tab.
- When you click the notebook, it will open in
- To edit the notebook, click the pencil icon.
- Access the Info panel.
- On the General tab, edit the name and description of the notebook.
- Click the Environment tab to see where you can change the environment used to run the notebook or update the runtime status to either stop and restart.
Task 5: Share read-only version of the notebook
Create a link to the notebook to share with colleagues.
- Click the Share icon if you would like to share the read-only view of the notebook.
- Click to turn on the Share with anyone who has the link toggle button.
- Select what content you would like to share through a link or social media.
- Click Close.
Task 6: Schedule a notebook to run at a different time
Create a job to schedule the notebook to run at a specific time or repeat based on a schedule.
- Click the job icon, and select Create a job.
- Provide the name and description of the job, and click Next.
- Select the notebook version and environment runtime, and click Next.
- (Optional) Click the toggle button to schedule a run. Specify the date, time and if you would like the job to repeat, and click Next.
- (Optional) click the toggle button to receive notifications for this job, and click Next.
- Review the details, and click either Create (to create the job, but not run the job immediately) or Create and run (to run the job immediately).
- The job will display in the Jobs tab in the project.
Now you can use this data set for further analysis. For example, you or other users can do any of these tasks:
- View more videos for notebooks.