Lab 1: DataFrames (Browser Version)
This version of Lab 1 runs entirely in your browser using JupyterLite - no installation required!
What is JupyterLite?
JupyterLite is a Jupyter distribution that runs completely in your web browser using WebAssembly. It includes pandas, numpy, and matplotlib pre-installed, making it perfect for getting started with data science without any setup.
Launch JupyterLite
Click the button below to open JupyterLite in a new tab:
Launch JupyterLite :material-rocket-launch:
Steps
Step 1: Create a New Notebook
- Click the Launch JupyterLite button above
- In JupyterLite, click File → New → Notebook
- Select Python (Pyodide) as the kernel
Step 2: Load the Healthcare Dataset
Copy and paste the following code into the first cell and press Shift+Enter to run it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
How This Works
JupyterLite runs in your browser, which has security restrictions on fetching data from other websites. We use Pyodide's special pyfetch function to handle this. The await keyword is needed because fetching data over the network is asynchronous.
Step 3: Explore the DataFrame
Add a new cell and run this code to explore the data:
1 2 3 4 5 6 7 | |
Step 4: Basic Statistics
Add another cell to see summary statistics:
1 2 3 | |
Step 5: Find Specific Countries
Let's find some interesting data points:
1 2 3 4 5 6 7 8 9 10 11 | |
Expected Output
After running all cells, you should see output similar to:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Troubleshooting
"CORS Error" or Data Won't Load
If you encounter a CORS error, you can use this alternative approach with the data embedded directly:
Click to expand: Embedded Data Alternative
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Kernel Won't Start
- Try refreshing the page
- Clear browser cache and try again
- Use a different browser (Chrome or Firefox work best)
Next Steps
Once you're comfortable with JupyterLite, consider setting up a local Python environment for more advanced work. See the Desktop Setup Guide for instructions.
Comparison: Browser vs Desktop
| Feature | JupyterLite (Browser) | VS Code (Desktop) |
|---|---|---|
| Setup required | None | Python + VS Code installation |
| Works offline | No | Yes |
| File access | URLs only | Full filesystem |
| Library support | Core data science libs | Any Python package |
| Performance | Good for small datasets | Better for large datasets |
| Best for | Quick experiments, learning | Real projects, large data |