About 30 minutes, most of it waiting for the download. Do it at home on a good connection, not in the classroom.
Anaconda bundles Python with Pandas, Matplotlib, Seaborn, SciPy, statsmodels and Jupyter, the tools for all four sessions.
Go to anaconda.com/download. The site asks for an email address; you can use Skip registration below the form.
Choose the Windows 64-Bit Graphical Installer (the .exe file).
Choose the Graphical Installer (the .pkg file) that matches your chip:
Double-click the .exe file and accept the defaults, with two things to check:
C:\Users\Hélène Dupont.) The installer may refuse the default location. Install to C:\anaconda3 instead.Double-click the .pkg file and follow the steps. Choose Install for me only and accept the defaults. Enter your Mac password when asked.
The installation takes 5–15 minutes. Wait until it says it has finished.
Open the Start menu and search for Anaconda Prompt. Use this, not the ordinary Command Prompt or PowerShell. The line should start with (base).
Open Terminal (⌘ + Space, type “Terminal”). If it was already open, close it and open a new one. The line should start with (base).
Type this and press Enter:
python --versionAny version from 3.10 up is fine.
Each session comes as a notebook plus the dataset. Keep them in one folder with this layout, because the notebooks look for the data at data/raw/.
Download the course pack from the course platform and unzip it to a place you can find, such as your Documents folder. You should get:
In the Anaconda PromptTerminal, move into the folder, then start JupyterLab:
cd %USERPROFILE%\Documents\PGE5-Python
jupyter labcd ~/Documents/PGE5-Python
jupyter labYour browser opens JupyterLab. Keep the terminal window open: closing it stops Jupyter.
Prefer clicking? Open Anaconda Navigator, launch JupyterLab, and browse to the PGE5-Python folder in the left panel.
In JupyterLab, click File → New → Notebook (choose the Python 3 kernel), save it inside PGE5-Python, paste this into the first cell and press Shift + Enter.
import pandas as pd, matplotlib, seaborn, scipy, statsmodels
print("pandas", pd.__version__)
df = pd.read_excel("data/raw/default of credit card clients.xls", header=1)
print(df.shape)(30000, 25)? You are ready for Session 1. Version numbers may differ from the ones shown here.If you get an error instead, find it below.
Read the last line of the error message first. It usually names the problem.
The old .xls Excel format needs one extra package. Run this in a notebook cell, then restart the kernel (Kernel → Restart Kernel) and run your cell again:
%pip install xlrdJupyter is running from a different folder than the one holding data/. Check where you are:
import os
print(os.getcwd())
print(os.listdir())The list should include data. If it doesn't, save your notebook inside PGE5-Python (next to session1.ipynb), or restart Jupyter from that folder as in step 2.
You are in the ordinary Command Prompt or PowerShell. Close it and open Anaconda Prompt from the Start menu.
Close Terminal completely (⌘ + Q) and open it again. If the line still does not start with (base), run the command below, then reopen Terminal:
~/anaconda3/bin/conda init zshThe notebook is using a Python other than Anaconda's. This happens most often in VS Code or PyCharm. For this course, start Jupyter from the Anaconda PromptTerminal as in step 2. If you want to stay in your editor, run %pip install pandas seaborn statsmodels xlrd in a cell.
Open System Settings → Privacy & Security, scroll down, and click Open Anyway next to the Anaconda message.
Your user folder contains spaces or accented characters. Run the installer again and change the destination to C:\anaconda3. If your laptop is managed by an employer, you may lack admin rights; use Colab (below) and tell me before the session.
Use Google Colab (next section). It runs in the browser and gives the same results.
Nothing to install, only a Google account. Use it if the installation fails or on the day your laptop misbehaves. Files you upload are deleted when the session ends, so download your notebook before closing the tab.
Go to colab.research.google.com, choose File → Upload notebook and select session1.ipynb from the course pack.
Run this in the first cell:
!mkdir -p data/raw
%pip install -q xlrdClick the folder icon in the left sidebar. Open data → raw, hover over raw, click the ⋮ menu → Upload, and pick default of credit card clients.xls.
You should see (30000, 25). The paths in the course notebooks now work unchanged.
Before you close the tab: File → Download → Download .ipynb.
Tick these off. Your ticks are saved in this browser only.