Before you model anything, what does the data actually look like?
HEC Montréal
pd.read_parquet and .dropna, and say how many rows went.quantile| 1 | Read the paper | 45–60 min |
| 2 | Get both datasets — the paper’s, and your own angle | 10 min |
| 3 | Attempt the self-check | 15 min |
The lecture assumes all three are done. The practice assumes the data is already cached on your machine.
Fraiberger et al. (2021), Media sentiment and international asset prices
Read for the argument, not for coverage. Annotate four things:
| 1 | The research question, in one sentence |
| 2 | The method or design, and why they chose it |
| 3 | The strongest single piece of evidence |
| 4 | One limitation you would raise as a referee |
The practice uses two: the paper’s data, to reproduce one of its results, and your own angle, to apply the method. Have both before you arrive — the first is 33 MB and takes a couple of minutes on room wifi.
qmibFrom the repository root, in the VS Codium terminal:
macOS and Linux
mkdir -p 02-exploratory-data-analysis/data/replication
cd 02-exploratory-data-analysis/data/replication
curl -L -o replication.zip \
"https://dataverse.harvard.edu/api/access/dataset/:persistentId/?persistentId=doi:10.7910/DVN/QNKFJF"
unzip -q replication.zip && rm replication.zip
cd -Windows PowerShell
mkdir 02-exploratory-data-analysis/data/replication
cd 02-exploratory-data-analysis/data/replication
curl.exe -L -o replication.zip `
"https://dataverse.harvard.edu/api/access/dataset/:persistentId/?persistentId=doi:10.7910/DVN/QNKFJF"
Expand-Archive replication.zip .; Remove-Item replication.zip
cd -No Dataverse account and no browser needed — that URL is their public download API.
You should see code/, data/ and results/. The code/ folder is Stata .do files — you are not running them; you are reproducing one result in Python, and the practice tells you which.
data/replication/ is git-ignored, so nothing large is ever committed. If git status shows the zip, you are in the wrong folder.
import qmib
core = qmib.load("core") # the spine — every group uses this
mine = qmib.load("angle_c_country") # YOUR angle — see your data dictionary
print(core.shape, mine.shape)(450, 11) for the spine. Anything else, or a traceback, bring it to class.
Replace angle_c_country with your own angle. Your group’s is named in RESEARCH-MANDATES.md. qmib.catalog() lists every dataset in the course.
qmib.load downloads once and caches as parquet, so the practice works whatever the room’s wifi is doing — which is the reason for doing it the night before.
Answer these on paper. If you cannot, that is what the lecture is for.
By the end of the session you should be able to:
Arrive with: the paper read and annotated · the replication package unzipped · qmib.load() run at least once · your self-check answers on paper.
Everything runs in the VS Codium terminal, from the repository root, with the project environment active. Activate it in every new terminal, not only the first:
Your prompt must begin with (.venv). Without it python and pip are your system’s, and nothing the course installed is visible to them.
ModuleNotFoundError means the packages went somewhere else, or were never installed. Check the prompt first, then pip install -r requirements.txt — from the repository root, with the environment active. Building the environment from scratch is Session 01, step 1.4.
Session 02: README.md · the lecture: 01-lecture/
Two things, and everything in the rest of this deck is one of them.
group-XX in this one.groups/A2026/group-XX/.github.com/warint/quantitative-methods
│
├── main ← the instructor's. You never push to it.
├── group-01 ← group 01's branch
└── group-XX ← yours
Why not one repository per group. scripts/assess.py contributions reads your commit history from this repository. Work pushed anywhere else is invisible to it — and invisible work counts as work you did not do.
The repository ships with two levels and no more:
groups/
└── A2026/ ← the cohort: autumn 2026. Empty.
Your group creates the third. Nobody has made one for you, because group numbers are not fixed until Session 04.
Committing that folder with a file in it is how your group comes into existence in this repository. There is no other registration step.
groups/
└── A2026/
├── group-03/
│ ├── session-02/
│ └── session-03/
└── group-07/ ← yours
├── session-02/ ← one folder per practice
├── session-03/
└── ...
Your whole term is one directory, which is how you find in week ten what you wrote in week two. The cohort folder above it is what lets next year’s students start clean instead of on top of you.
Git does not track empty folders. mkdir alone commits nothing — the folder appears in the repository only when it has a file inside it.
macOS. Git ships with Apple’s Command Line Tools, so most Macs already have it. If the command is not found, macOS offers to install them — accept — or run xcode-select --install. You do not need Homebrew.
sudo apt install gitUse your real name and the email on your GitHub account. The commit log is one of the four records used to check that all three of you did the work — and it only identifies you if you set this. Do it before your first commit; it does not apply retroactively.
Then send your GitHub username to the instructor. You cannot push until you have been added as a collaborator, and that is done by hand. Cloning works without it — pushing does not.
Session 01 had you unzip to Desktop/quantitative-methods. The clone wants that exact path, so it will refuse to start while the old folder is there:
Rename it rather than deleting it — anything you wrote during Session 01 is still in there.
A ZIP cannot push. From here you work in a clone — in the same place the ZIP was, so every path in the course still matches.
cd ~/Desktop # Windows: Set-Location "$HOME\Desktop"
git clone https://github.com/warint/quantitative-methods.git
cd quantitative-methods
pwd # expect /Users/you/Desktop/quantitative-methodsThen File → Open Folder… in VS Codium and choose the new folder.
Copy anything you wrote in Session 01 out of quantitative-methods-session01, then delete it. Two copies of the course on one Desktop is the most reliable way to spend an hour editing the file you are not running.
.venv is not in the repository — it is built per machine, and the one in your old ZIP folder belongs to that folder. Name the version, as in Session 01:
Then activate it, and check the prompt before installing anything:
There is no python3 on Windows — use py. If it answers Python introuvable, the Microsoft Store alias is shadowing it: Session 01, “Windows: Python introuvable”.
The whole setup, checked in one line:
(450, 11) means you are ready. Anything else — bring the error to class.
GitHub rejects your account password and asks for a token instead.
repo scope, set an expiryPaste it once and the system keychain remembers it. If you lose it, generate another; tokens are disposable.
One person per group creates it. The others check it out.
# the first person, once — group 07 shown; use your own number
git checkout -b group-07
git push -u origin group-07Never push while on main. It is protected, so the push is refused rather than doing damage — but check where you are before you commit: git branch --show-current
git pull # always pull before you start
mkdir -p groups/A2026/group-07/session-02 # Windows: mkdir, without -p
echo "# Group 07 — session 02" > \
groups/A2026/group-07/session-02/NOTES.md
git add groups/A2026/group-07/session-02/
git commit -m "Add group 07 notes for session 02"
git pushRefresh the repository page, switch to your branch, and the file is there.
Each of the three of you does this at least once, from your own machine. Not one per group. git log --oneline -5 should show three commits with three different author names — that is exactly what the participation record is.
| What you see | What it means | What to do |
|---|---|---|
rejected — non-fast-forward |
someone pushed in between | git pull, then push again |
Authentication failed |
the password is not the token | Step 5 again, generate a fresh one |
Permission denied |
not yet a collaborator | send your username to the instructor |
detached HEAD |
you checked out a commit, not a branch | git checkout group-07 |
a conflict marker <<<<<<< |
two people edited the same lines | keep both sides, delete the markers, commit |
A rejected push is normal and means the system is working. The full written guide, with more on conflicts and working together, is setup-git-and-github.md.
MATH60033A · Session 02 pre-session · Thierry Warin, PhD · HEC Montréal