import data2thesis as dt
students = dt.load_students()
print(f"Loaded {students.shape[0]} students and {students.shape[1]} variables.")Loaded 600 students and 14 variables.
This appendix explains how to install everything the book uses, how to configure your working environment, and how to resolve the issues that most often arise. If you want to get started immediately, the short version is: install Python, install Visual Studio Code, create a virtual environment, and install the companion packages with pip. If you are not ready to install anything locally yet, every chapter’s exercises can also be run directly in your web browser in the interactive playground.
Software installers and websites update their appearance over time, so this appendix describes each step in clear terms. The essential configuration choices remain consistent across versions.
| Software | What it is | Required? |
|---|---|---|
| Python (3.10+) | The programming language and computation engine | Yes |
| VS Code | Code editor with integrated terminal, plot viewer, and notebook support | Yes (or Positron) |
| Positron | Modern data science IDE by Posit, designed for Python and R | Optional |
| Quarto | Authoring tool that compiles research code into papers, books, and slides | Yes |
| Scientific packages | Libraries (pandas, seaborn, scipy, etc.) installed via pip |
Yes |
| data2thesis | Companion package containing all Graduate Wellbeing Study datasets | Yes |
All of these tools are free and open source. Python should be installed first so that editors and tools can discover your Python interpreter automatically.
Python is downloaded from the official Python Software Foundation website at python.org/downloads. Always download the latest stable release (version 3.10 or newer; 3.12 is recommended).
On python.org, download the macOS 64-bit universal installer (.pkg).
Run the package installer and accept the standard defaults.
After installation completes, navigate to your Applications folder, open the Python 3.x folder, and double-click Install Certificates.command to ensure secure network connections (SSL) function properly when downloading datasets and packages.
Alternatively, if you use Homebrew, you can install Python directly from Terminal:
Python comes pre-installed on most modern Linux distributions. On Debian/Ubuntu distributions, ensure the development packages and package manager are installed:
Open your system terminal (Command Prompt or PowerShell on Windows; Terminal on macOS and Linux) and type:
If it prints Python 3.12.x (or any version 3.10+), Python is installed and accessible.
Ctrl+Shift+X / Cmd+Shift+X).Positron (positron.posit.co) is a specialized code editor built by Posit for scientific data analysis in Python and R. It provides dedicated panes for Variables, DataFrames, and Plots out of the box. Everything taught in this book works identically in VS Code and Positron.
In empirical research, package versions evolve. To prevent package updates from inadvertently altering your thesis calculations months later, create a virtual environment for your research project. A virtual environment is an isolated directory containing its own Python interpreter and set of installed libraries.
In your research project folder:
When activated, (.venv) appears at the start of your terminal command line. In VS Code, press Ctrl+Shift+P (or Cmd+Shift+P), type Python: Select Interpreter, and choose the interpreter inside your .venv directory.
Scientific libraries are installed using Python’s package manager, pip. Each chapter in the book uses specific packages; Table 1.2 summarizes the primary libraries used across chapters.
| Chapters | Libraries |
|---|---|
| 1–3 | pandas, numpy, openpyxl, pyreadstat |
| 4 | matplotlib, seaborn |
| 5–7 | scipy, statsmodels |
| 8–10 | statsmodels (OLS, GLM, MixedLM) |
| 11–13 | scikit-learn, xgboost |
| 14 | scikit-learn (K-Means, DBSCAN, GMM, PCA) |
| 15 | scikit-learn, torch (PyTorch) |
| 16 | statsmodels (ARIMA, seasonal decomposition) |
| 17 | quarto, shiny, matplotlib |
| 18 | requests, openai / ollama |
| 19 | pandas, statsmodels, seaborn |
To install all required packages into your virtual environment in a single command, run:
data2thesis packageThe case-study data for Elaf’s research is bundled in the companion package data2thesis. You can install it directly via pip:
Verify that the package and dataset load properly:
Loaded 600 students and 14 variables.
All datasets are also available as direct CSV, Excel, and SPSS downloads on the book website.
The analyses in this edition were executed with the following package versions:
| Software | Version | |
|---|---|---|
| 0 | Python | 3.12.15 |
| 1 | pandas | 3.1.0 |
| 2 | numpy | 2.5.4 |
| 3 | scipy | 1.18.1 |
| 4 | statsmodels | 0.15.0 |
| 5 | scikit-learn | 1.9.1 |
| 6 | data2thesis | 1.1.0 |
'python' is not recognized as an internal or external commandC:\Users\Username\AppData\Local\Programs\Python\Python312\) to your system Environment Variables.
ModuleNotFoundError: No module named '...'Ctrl+Shift+P), select Python: Select Interpreter, and choose your project’s .venv. Then run pip install <package-name>.
Execution of scripts is disabled on this system (Windows PowerShell)File not found when loading datasetsdata/students.csv), or use the helper function dt.load_students(). Avoid absolute paths like C:\Users\Elaf\Desktop\data.csv, which fail when shared with supervisors or collaborators.