Why structure matters more than it seems

My first few data science projects were a single folder with a notebook, a CSV, and a growing pile of files named things like analysis_v2_final.ipynb. It worked until I needed to revisit the project two months later and had no idea which file was the real one or where the original data had gone. Now I spend ten minutes setting up structure before I write any actual analysis, and it pays for itself every single time.

The folders I always create

  • data/raw for the original files, untouched, treated as read-only.
  • data/processed for cleaned versions, generated by code, never edited by hand.
  • notebooks for exploration and quick experiments.
  • src for functions and pipeline code that the notebooks call into.
  • outputs for charts, reports, and trained model files.

This separation means I can always regenerate processed from raw if something goes wrong, because the original data is never touched directly.

The workflow inside that structure

I start every project the same way: load the raw data, explore it in a notebook, and once a cleaning step works, move that logic into a function in src. The notebook then becomes a thin script that calls functions instead of holding all the logic itself. This keeps the notebook short enough to actually read later, and it means the same cleaning function gets reused for training and for any new data that comes in afterward.

What this saves me later

When a teammate or a future version of myself opens the project, the structure itself explains what happened: raw data came in, code transformed it, and outputs came out. There is no guessing about which notebook is current or whether a CSV was edited by hand. The structure is boring on purpose. Boring and predictable is exactly what you want when you need to trust a project again after time has passed.