Project Directory Structure
You'll learn how organizing your project into a standard directory layout makes your work reproducible, collaborative, and maintainable.
Why Structure Matters
Imagine walking into someone's kitchen where utensils, ingredients, and dishes are scattered randomly. You'd waste time searching for everything. The same applies to data science projects—without a clear structure, collaborators (including your future self) will struggle to understand what's where.
A well-organized project directory separates concerns, making it immediately clear where to find data, code, notebooks, models, and outputs.
Standard Directory Layout
Most data science projects benefit from this structure:
project-name/
├── data/
│ ├── raw/ # Original, immutable data
│ ├── interim/ # Intermediate transformations
│ └── processed/ # Final, analysis-ready datasets
├── notebooks/ # Jupyter/R Markdown exploration
├── src/ # Reusable Python/R modules
├── models/ # Trained models and artifacts
├── reports/ # Generated analysis (HTML, PDF)
│ └── figures/ # Graphics for reports
├── tests/ # Unit tests for your code
├── requirements.txt # Dependencies (or environment.yml)
├── .gitignore # Files to exclude from version control
└── README.md # Project overview and setup
Key Principles
Separation of concerns: Raw data stays untouched in data/raw/. Processing scripts live in src/, not scattered through notebooks. This prevents accidental data corruption and makes your pipeline traceable.
Notebooks vs code: Use notebooks (notebooks/) for exploration and communication. Move stable, reusable functions to src/ modules that notebooks can import.
Outputs are generated: Everything in reports/ and models/ should be reproducible from code—don't edit these files manually.
Key Takeaway: A standard project directory structure with separated data, code, notebooks, and outputs makes your work instantly understandable, prevents errors, and ensures anyone can reproduce your results.