FB2NEP — How‑To & Sandbox (Colab/Jupyter)
This page shows you how to open and use the module notebooks in Google Colab (or locally in Jupyter). It includes direct links and easy to understand guidance. If you have never used Python before, you are in the right place.
1 Quick links
Open the notebooks directly in Colab:
Introduction Notebook
· View on GitHub
Playground (Sandbox)
· View on GitHub
Printable cheat‑sheet:
- python‑cheatsheet.md (open “Raw”, then save/print)
If you fork or use a different repository, update the links by replacing
ggkuhnle/fb2nep-epiwith your repo slug.
What does “fork” mean on GitHub?
A fork is your own copy of someone else’s GitHub repository under your GitHub account.
You can change it freely without affecting the original. Your fork can still receive updates from the original (“upstream”).
Why fork? - You want your own version of the materials. - You don’t have write permission on the original repo. - You plan to customise and maybe propose changes back later (via pull requests).
How to fork (GitHub web): 1. Open the original repo (e.g. https://github.com/ggkuhnle/fb2nep-epi). 2. Click Fork (top-right) → choose your account → Create fork. 3. You now have https://github.com/<YOUR-USER>/<YOUR-REPO>.
Update links after forking Replace the owner/repo part with your fork’s repo slug: - GitHub view:
https://github.com/<YOUR-USER>/<YOUR-REPO>/blob/main/path/to/notebook.ipynb - Colab badge:
https://colab.research.google.com/github/<YOUR-USER>/<YOUR-REPO>/blob/main/path/to/notebook.ipynb
Fork vs. clone vs. branch (quick) - Fork: makes your own repo on GitHub. - Clone: makes a local copy on your computer. - Branch: a line of development inside one repo (yours or the original).
Keeping your fork up-to-date - On GitHub: open your fork and click Sync fork / Fetch upstream. - With Git (advanced):```bash git remote add upstream https://github.com/ggkuhnle/fb2nep-epi.git git fetch upstream git checkout main git merge upstream/main git push
2 How to open a notebook in Colab (step‑by‑step)
What is Colab? Colab is a hosted Jupyter Notebook service that requires no setup to use and provides free access to computing resources, including GPUs and TPUs. Colab is especially well suited to machine learning, data science, and education. Requires a Google account.
Right-clicking will open Colab in a new browser window.
- Click an Open in Colab button above. Colab will load the notebook from GitHub.
- At the top‑right, click Connect if it isn’t already connected. This starts a fresh, temporary Python session (a “runtime”).
- You may see a warning like “This notebook was not authored by Google.”
- Click Run anyway. Our notebooks are plain text and safe to run.
- Click Run anyway. Our notebooks are plain text and safe to run.
- You might also see “Warning: This notebook requires permissions to run.”
- Click Run anyway. Colab sandboxes code; nothing runs on your computer.
- Click Run anyway. Colab sandboxes code; nothing runs on your computer.
- To run a cell, click the small ▶ button on its left, or press Shift + Enter.
- To run every cell from top to bottom, go to Runtime → Run all.
- To save your own editable copy, go to File → Save a copy in Drive. You now have a personal copy you can edit freely.
2.1 Useful Colab options
- Runtime → Restart runtime resets the session if things get stuck.
- Runtime → Change runtime type (we use Python 3; no GPU needed).
- File → Download lets you save the executed notebook as
.ipynbor PDF.
3 How to open a notebook in Binder (step‑by‑step)
What is Binder? Binder turns a GitHub repository into a live, interactive Jupyter environment running in your browser. No account or login required — just click and go.
Note: Binder may take 1–2 minutes to start the first time, as it builds the environment. Your work is not saved between sessions — download your notebook if you want to keep it.
- Click an Open in Binder badge above. A new tab will open and Binder will begin building the environment.
- Wait for the progress bar to complete. You will see log messages scrolling — this is normal.
- Once loaded, the notebook will open automatically in Jupyter.
- To run a cell, click it and press Shift + Enter, or use the ▶ button in the toolbar.
- To run all cells, go to Cell → Run All in the menu.
- To save your work, go to File → Download as → Notebook (.ipynb) before closing. Binder sessions are temporary and do not persist.
3.1 Useful Binder notes
- Session timeout: Binder sessions close after ~10 minutes of inactivity. Save your work regularly.
- No GPU needed for these notebooks — the default Binder environment is fine.
- Slow start? This is normal on first launch. Once running, the notebook behaves identically to any other Jupyter environment.
4 Working locally in Jupyter (optional)
If you prefer local execution: 1. Install Anaconda or Miniconda, then open Jupyter Lab.
2. Download the .ipynb files from GitHub and open them in Jupyter Lab.
3. Run cells with Shift + Enter as in Colab.
5 Troubleshooting
- ModuleNotFoundError (e.g.
statsmodels): in Colab, run the cell that starts with!pip install ..., then Runtime → Restart runtime, and re‑run the code. In Binder, all packages are pre-installed — if a module is missing, try Kernel → Restart.
- Kernel crashed / out of memory: restart the runtime. Don’t open huge datasets in this sandbox.
- Long‑running cells: click the stop icon (■) next to the cell number, or Runtime → Interrupt execution (Colab) / Kernel → Interrupt (Binder).
- Binder won’t load: try refreshing the page. If it continues to fail, use Colab as a fallback.
6 What you will learn here
- How to run Python cells safely in the cloud (Colab or Binder).
- How to make small edits and immediately see their effect.
- How to generate simple synthetic data and make basic plots & analyses you’ll reuse in FB2NEP.
Now jump into the Introduction Notebook first, then play in the Playground.