This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Python 3.14.3 in a virtual environment named
myenvon macOS (Apple Silicon M5) - Primary IDE: JupyterLab — almost all work lives in
.ipynbnotebooks - The active environment is activated with
source myenv/bin/activate
# Create and activate the virtual environment
python3 -m venv myenv
source myenv/bin/activate
# Core dependencies
pip install pandas numpy matplotlib seaborn scikit-learn statsmodels pmdarima scipy
pip install openai anthropic jupyterlab yfinance sqlalchemy
# Launch JupyterLab
jupyter labAPI keys are loaded from the shell environment, never hardcoded:
export ANTHROPIC_API_KEY='sk-ant-...' # add to ~/.zshrc| Folder | Contents |
|---|---|
python_vignettes/ |
Language fundamentals, pandas, numpy, plotting, stats, OOP, R-to-Python (_r2p suffix) conversions |
machine_learning/ |
Supervised learning notebooks following ISLR chapters (Ch3, Ch4, Ch8, Ch10); Kaggle examples; LLM hello world; agentic AI vignette |
toolbox/ |
Reusable standalone notebooks: descriptive stats, prediction metrics, visualization helpers |
use_cases/ |
End-to-end applied analyses on public datasets (migration, FIFA, markets) |
data/ |
CSV/XLS/SQLite datasets used across notebooks |
Every notebook opens with a module-level docstring (Cell [1]) that includes:
@author,@institution,@environment, description, and revision history- A structured
Revision History:block with dates and bullet points
Some notebooks have a paired .py file (e.g. python_functions_vignette.py alongside .ipynb). The python_vignettes/ folder also has importable modules:
my_stats_ftns_module.py— hand-rolledmean_s()/stdev_s()using only Python built-insfunctions_vignette_library.py— function-pattern library imported bypython_functions_vignette.ipynbmy_stats_ftns_calls.py— caller script for the stats module
_r2psuffix — notebooks that are direct R-to-Python translations_vignettesuffix — focused demonstrations of a single concept or library_oosuffix — object-oriented implementations_ISLR_ChN— tied to a specific chapter of Introduction to Statistical Learning with Python
The agent loop pattern used here:
- Define Python tool functions (
get_stock_price,get_portfolio_summarybacked byyfinance) - Register JSON tool schemas with Claude
- Loop: send message → receive
tool_use→ execute Python function → feed result back → repeat untilend_turn
Uses claude-haiku-4-5-20251001 for speed/cost. The dispatch table (TOOL_FUNCTIONS) maps tool names to callables.
git add <file>
git commit -m "Descriptive message"
git pushSee git_cheatsheet.md for PAT renewal and full reference.