Skip to main content

Your First Notebook

In this chapter you'll look at how to create your first Juypter Notebook, using Google Colabatory, which is a platform that hosts Notebooks online. This will allow you to quickly work with Python without having to set up anything on your computer.

Most of the chapters in this book will have an acompanying notebook, so understanding how they work is essential if you want to follow along with the Python exercises.

In this chapter you'll learn:

  • What a Juypter Notebook is and how to create a notebook using Google Colabatory
  • How to add text and Python code to a notebook
  • How to load and present CSV data in a notebook
  • How to use Generative AI to help you learn how to code in Python and plot your data

The video below goes through each of the steps above. Below the video are instructions you can follow along with.

This notebook is available at E2AI - Your First Notebook.ipynb

Instructions

  • Open Colabatory and sign in or sign up if you don't have an account
  • Select 'New Notebook'
  • In the 'start coding' box, try typing some basic Python such as 1+1
  • Now execute the code by pressing the ▶️ (Play) button or by pressing Ctrl+Enter (or ⌘ + Enter)
  • You should see the result of the code on the screen
  • Press 'Files' on the sidebar
  • Upload the ch01-sales.csv file
  • Add some more text and experiment with Markdown Syntax
  • Add a new code block and type plot csv as line chart and choose 'generate' to generate code with AI
  • Verify that the new code is correct - it should use matplotlib to create a chart object and should plot Date against Amount (USD)
  • Execute the code - you should see a plot of your data

Resources