02 — Methods / Series in 5 Parts
Python Vibe Coding Course
This course is designed for researchers, graduate students, and undergraduates who have never used Python before. You will write code by talking with an LLM (large language model) such as ChatGPT, a style known as "vibe coding." We especially recommend it if you have hit the limits of Excel or want to make your analyses reproducible.
Course goals
- Set up a Python execution environment on your own PC
- Write and run Python code by talking with an LLM
- Handle errors on your own when they occur
- Share your analysis environment in a reproducible form (requirements.txt)
- Upload your analysis package to Zenodo or GitHub when publishing a paper
Contents
An introduction to Python and environment setup
Why choose Python, what it means to write and run code, and the concepts of environment setup, libraries, and reproducibility. A map of the entire course.
Set up VSCode and a virtual environment, and run your first code
Takes you from start to finish in one go. You install VSCode, create a folder, a virtual environment (venv), and an .ipynb file, then run Hello World and output basic statistics from an Excel file.
Vibe coding by asking ChatGPT to write your code
How to prompt an LLM, describe your folder structure, handle errors, and improve the code step by step. Includes important notes on handling personal and confidential data.
Ensure reproducibility by saving your environment in requirements.txt
How to use pip freeze to export your current environment to requirements.txt so that others can reproduce the same setup. Also covers common pitfalls.
Publish your code on Zenodo and GitHub alongside your paper
How to organize your analysis package folder, publish it on Zenodo (with a DOI) or GitHub, and add the link to your paper's Appendix.