Ravindra BagaleCourses & study guides मराठी Track your progress

27. How to Use Git with Jupyter Notebooks for Data Projects

27.2 Project Folder Layout

Why. Mixing raw CSV, cleaned CSV, charts, and notebooks in one pile breaks teammates and your future self.

What. A simple layout that matches Chapter 22 folder hygiene:

blinkit_mh_lab/
  data/raw/          # original extracts (often gitignored if huge)
  data/clean/        # reproducible cleans
  notebooks/         # *.ipynb
  outputs/           # csv / png for managers
  .gitignore
  README.md

How.

Create the skeleton

  1. Make the folders above.
  2. Put your main notebook under notebooks/.
  3. Write outputs only under outputs/.
  4. Keep a short README.md (how to run, fictional data note).
  5. git init inside blinkit_mh_lab/ (once).

Worked example A — mkdir (shell).

mkdir -p blinkit_mh_lab/data/raw blinkit_mh_lab/data/clean \
  blinkit_mh_lab/notebooks blinkit_mh_lab/outputs
cd blinkit_mh_lab
git init

Worked example B — README stub.

# Blinkit Maharashtra lab (fictional)

Sample orders for learning pandas. Not real company data.
Run notebooks in order: 01_clean.ipynb → 02_eda.ipynb

Worked example C — Paths inside notebook.

from pathlib import Path
ROOT = Path("..").resolve()  # if notebook is in notebooks/
RAW = ROOT / "data" / "raw"
OUT = ROOT / "outputs"
OUT.mkdir(exist_ok=True)

Ravindra Bagale's Tip

raw / clean / outputs — teen boxes. Notebook logic Git madhe; multi-GB raw usually baher.