# Your first code cell! Click this cell and press Shift+Enter to run it.
print("Welcome to Data Science with Python!")
print(f"Par for this course: 72")
print(f"Your score: let's find out!")Getting Started
Welcome to Introduction to Data Science with Python. In this course, we’ll learn how to use Python to explore, analyze, and visualize data — with all of our examples drawn from the world of golf.
This first topic gets you set up with the tools you’ll use throughout the course.
What You’ll Learn
- Install Python 3.12+
- Set up a project environment with
uv - Install and use VS Code with Jupyter notebooks
- Run Python in different ways (scripts, REPL, notebooks)
- Get introduced to AI coding tools
Concept: Why Python for Data Science?
Python is the most popular language for data science. Why?
- Readable syntax — Python reads like English, making it accessible to beginners
- Rich ecosystem — Libraries like pandas, matplotlib, and numpy handle data analysis, visualization, and computation
- Community — Millions of developers, thousands of tutorials, and AI tools that understand Python deeply
- Versatility — From scripts to web apps to machine learning, Python does it all
Throughout this course, we’ll use golf data as our domain. You’ll analyze rounds, visualize scoring trends, and eventually calculate advanced statistics like strokes gained — all using Python.
Code: Setting Up Your Environment
Step 1: Install Python 3.12+
Download and install Python from python.org. Make sure you get version 3.12 or higher.
Verify your installation by opening a terminal and running:
python3 --versionYou should see something like Python 3.12.x or Python 3.13.x.
Step 2: Install uv
uv is a modern, fast Python package and environment manager. It replaces the older tools like pip, virtualenv, and conda with a single, fast tool.
Install uv:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Verify it’s installed:
uv --versionStep 3: Clone the Course Repository and Set Up the Environment
# Clone the course repo
git clone https://github.com/BrianKolowitz/data-focused-python.git
cd data-focused-python
# Create a virtual environment and install dependencies
uv venv
uv pip install -e ".[dev]"This creates an isolated Python environment in a .venv folder. Now you need to activate it:
# macOS / Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activateWhen activated, you’ll see (.venv) at the beginning of your terminal prompt. This means Python commands will use the project’s environment and packages — not your system Python.
# Verify you're in the virtual environment
which python # Should show .venv/bin/python
python --version # Should show 3.12+Tip: You need to activate the virtual environment every time you open a new terminal. VS Code can do this automatically — when you open a terminal in VS Code and it detects a
.venvfolder, it activates it for you.
To deactivate (go back to system Python):
deactivateWhy virtual environments? They keep each project’s dependencies separate. Your golf data science project won’t conflict with other Python projects on your machine.
Step 4: Install VS Code
Download Visual Studio Code — it’s free and works on all platforms.
Install these extensions:
- Python (by Microsoft) — Python language support
- Jupyter (by Microsoft) — Run notebooks directly in VS Code
To install extensions, click the Extensions icon in the sidebar (or press Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows) and search for each one.
Code: Running Python
There are three main ways to run Python. You’ll use all of them in this course.
Important: Make sure your virtual environment is activated before running any of the commands below. You should see
(.venv)in your terminal prompt. If not, runsource .venv/bin/activate(macOS/Linux) or.venv\Scripts\activate(Windows).
1. The Python REPL (Read-Eval-Print Loop)
The REPL is great for quick experiments. Open your terminal and type:
python3You’ll see a >>> prompt. Try it:
>>> 72 - 68
4
>>> print("4 under par!")
4 under par!
>>> exit()2. Python Scripts
For code you want to save and reuse, create a .py file and run it:
python3 my_script.py3. Jupyter Notebooks
Notebooks (like this one!) mix code, output, and explanations. They’re the standard tool for data science work.
Jupyter was installed as part of the course dependencies in Step 3. Verify it’s available:
# Make sure your venv is activated, then:
jupyter --versionIf this prints version info, you’re good. Start Jupyter Lab:
jupyter labThis opens a browser window where you can navigate to any .ipynb file in the course.
Alternatively, you can open .ipynb files directly in VS Code with the Jupyter extension — no need to run jupyter lab at all. VS Code will prompt you to select a Python kernel; choose the one from your .venv.
Troubleshooting: If
jupyteris not found, make sure your virtual environment is activated. If it’s still missing, reinstall:uv pip install jupyter
Let’s try running some code right now:
# Python can do math
par = 72
score = 78
relative_to_par = score - par
print(f"Score: {score} ({'+' if relative_to_par > 0 else ''}{relative_to_par})")# Check your Python version
import sys
print(f"Python version: {sys.version}")AI: Your AI Coding Assistant
Throughout this course, we’ll use AI tools alongside traditional coding. AI is transforming how we write code — but it’s a force multiplier, not a replacement for understanding.
Here’s the philosophy:
You need to understand the concept to evaluate AI output and ask the right questions.
Recommended AI Tools
- Claude — Anthropic’s AI assistant, excellent for code explanation and generation
- ChatGPT — OpenAI’s assistant, widely used for coding help
- Claude Code — AI coding agent that works directly in your terminal
- GitHub Copilot — AI code completion inside VS Code
How We’ll Use AI in This Course
Every topic follows a Concept → Code → AI structure:
- Concept — Understand what and why
- Code — Implement it yourself in Python
- AI — Use AI to do the same thing, then critically evaluate the result
Try It: Ask AI to Explain Something
Open Claude or ChatGPT and try this prompt:
“I’m learning Python for data science. Explain what a virtual environment is and why I need one. Keep it simple — I’m a beginner.”
Compare the AI’s answer to what you learned above. Did it get anything wrong? Did it explain anything better than this notebook did? This kind of critical evaluation is a skill you’ll build throughout the course.
Summary
You now have:
Next up: We’ll write our first real program — a golf score calculator.