Google Colab is a free notebook tool that runs in your web browser. It is a good option when you want to save a copy of your work in Google Drive.
Use Colab when:
- You want your notebook work saved in Google Drive.
- Binder is slow or unavailable.
- Your instructor asks you to submit a completed notebook file.
- You are already comfortable signing in with a Google account.
Binder is usually the easiest starting option. Colab is often better when saving work matters.
- Go to the course repository on GitHub.
- Open the
notebooks/folder. - Click the notebook you want to use.
- Copy the GitHub page URL from your browser.
- Open Google Colab.
- Select
File. - Select
Open notebook. - Select the
GitHubtab. - Paste the GitHub URL.
- Select the notebook and open it.
This option is useful because it starts from the official course notebook.
- Download the notebook file from the course repository or learning system.
- Open Google Colab.
- Select
File. - Select
Upload notebook. - Choose the
.ipynbnotebook file from your computer. - Wait for the notebook to open.
This option is useful if your instructor gives you a notebook file directly.
- Start at the top of the notebook.
- Read the instructions before running code.
- Click the play button beside the first code cell.
- Wait for the output to appear below the cell.
- Continue one cell at a time.
- Complete each TODO or practice step when you reach it.
Run cells in order. Later cells may depend on variables or code from earlier cells.
Some notebooks may use files from the course data/ folder.
- In Colab, look for the folder icon on the left side of the page.
- Click the folder icon to open the file panel.
- Click the upload button.
- Choose the needed data file from your computer.
- Wait until the file appears in the file panel.
- Run the notebook cell that uses the file.
Uploaded files may disappear when the Colab runtime resets. If that happens, upload the file again.
- Select
File. - Select
Save a copy in Drive. - Rename the copy if your instructor gives a required file name.
- Continue working in your saved copy.
- Before submitting, check that your latest changes are saved.
Saving a copy helps protect your work if the browser closes or the runtime resets.
- If Colab asks for permission to run the notebook, choose the option to continue.
- If the runtime resets, run the notebook again from the top.
- If a variable is missing, rerun earlier cells in order.
- If a data file is missing, upload the file again.
- Save your work before closing the browser tab.