DSM
40 XP
20 minsBeginner40 XP

The Data Science Workflow

Beginners think a data science project is 'build a model.' In reality, experienced practitioners spend most of their time long before and long after the model — framing the right question and cleaning messy data. There's a repeatable path through every project, and knowing it means you never stare at a dataset wondering 'what now?' By the end of this lesson you'll have that map.

What you'll learn

  • List the six stages of the data science workflow in order
  • Describe the goal of each stage in one sentence
  • Explain why the workflow is a loop, not a straight line
  • Identify which stage typically consumes the most time
  • Map a real business problem onto the workflow stages

What

The data science workflow is the sequence of stages nearly every project moves through: ask a question, collect data, clean it, explore it, model it, and communicate the result. It's a loop, not a straight line — you often go back a step.

Why

Without a workflow you jump straight to charts or models and get lost. The workflow gives every project a shared structure, so you always know what stage you're in and what comes next. It's also how teams divide and hand off work.

Where it's used

Every data science project at every company follows some version of this lifecycle. It underpins famous frameworks like CRISP-DM and the way data teams plan sprints and deliverables.

Where this runs in production

UberFrom question to surge model

A pricing project starts with a question ('where will demand spike?'), collects trip and weather data, cleans it, explores patterns by time and place, models the forecast, then ships it to the driver app — the full loop.

AirbnbCleaning eats the calendar

Airbnb's data scientists report that collecting and cleaning listing and booking data takes far more time than the modelling itself — a pattern true across the whole industry.

SpotifyCommunicate or it didn't happen

A great churn model is worthless until its findings reach the product team as a clear recommendation. The final 'communicate' stage is what turns analysis into action.

Theory

The core ideas, in plain language.

Every project starts by framing a question. 'Make the app better' is not a data science question. 'Which users are most likely to cancel in the next 30 days?' is — it's specific, measurable, and points at a decision. Getting this stage right saves you from answering the wrong thing perfectly.
Key Concept
The six stages

1) Ask — frame a specific, answerable question. 2) Collect — gather the data that could answer it. 3) Clean — fix errors, gaps, and wrong types. 4) Explore — summarise and visualise to find patterns (called EDA). 5) Model — build something that predicts or explains. 6) Communicate — turn the result into a decision others can act on.

Once you have a question, you collect the data that could answer it — from databases, files, surveys, or live systems. Then you clean it, because raw data is always messy: missing values, duplicates, typos, and columns stored as the wrong type (exactly the traps you learned to spot in Types of Data).
Analogy: Cooking a meal

Asking the question is deciding what dish to make. Collecting is buying ingredients. Cleaning is washing and chopping — unglamorous but most of the work. Exploring is tasting as you go. Modelling is the actual cooking. Communicating is plating it so someone wants to eat. Skip the washing and the whole meal suffers, no matter how good the recipe.

Exploring — often called EDA, Exploratory Data Analysis — is where you summarise and visualise the data to understand its shape before modelling. Only then do you model: build the thing that predicts or explains. Finally you communicate, translating numbers into a recommendation a manager can act on.
Watch out
The 80% rule

Surveys of working data scientists consistently find that collecting and cleaning data takes the majority of project time — often cited as around 80% — while modelling takes a small slice. If you expected the job to be mostly building models, this is the biggest surprise of the field.

Visual Learning

See the concept, then explore it.

The Data Science Lifecycle

Click each stage to see its goal and a real example. Note the arrow from Communicate back to Ask — the loop closes.

Worked Examples

Watch it built up, one line at a time.

Very EasyNaming the stage

A data scientist is removing duplicate rows and filling in missing prices in a sales file.

Step 1 of 1

Fixing errors, gaps, and duplicates in raw data is the definition of the Clean stage — stage 3.

Code
01activity = 'removing duplicates and filling missing values'
Output
Stage: Clean (3).
Practice Coding

Your turn — write the code.

Your task

Below are the six stages of the workflow, shuffled. Rebuild the correct order by filling the blanks so the list reads from the first stage to the last. Use these exact strings: "Ask", "Collect", "Clean", "Explore", "Model", "Communicate". Then run it.

Expected output
Ask -> Collect -> Clean -> Explore -> Model -> Communicate

Write your solution in the editor on the right, then hit Run.

Exercises

Prove it. Reach 80% to complete the lesson.

Mastery Gate0% / 80% required
Easy0/2 solved

What is the correct order of the six workflow stages?

Which stage typically takes the most time on a real project?

Medium0/3 solved

What does the 'Explore' (EDA) stage involve?

ScenarioWhile exploring the data, a data scientist realises the dataset simply doesn't contain the information needed to answer the original question.

What does the workflow suggest they do?

Match each activity to its stage. You're given two parallel lists: activities and their correct stages. Print each pair as 'activity -> stage', one per line, using a loop with zip().

Pairing:Each activity is printed with its matching stage.
Format:Uses the 'activity -> stage' format, one line each.
Hard0/1 solved
ScenarioA team builds an excellent, accurate churn model, but three months later leadership has taken no action based on it and cancellations are unchanged.

Which stage most likely failed?

Complete 80% more exercises to unlock.
Interview Prep

How this shows up in real interviews.

Walk me through the stages of a typical data science project.

Show model answer

I think of it as six stages. First, Ask — frame a specific, measurable question tied to a decision. Second, Collect — gather the data that could answer it. Third, Clean — fix missing values, duplicates, and wrong data types, which usually takes the most time. Fourth, Explore, or EDA — summarise and visualise the data to understand its shape and spot patterns. Fifth, Model — build something that predicts or explains. Sixth, Communicate — turn the result into a clear recommendation people can act on. The key nuance is that it's a loop: findings at any stage often send you back to refine an earlier one.

Why do experienced data scientists say most of their time goes to data collection and cleaning rather than modelling?

Show model answer

Real-world data is almost never analysis-ready. It arrives with missing values, duplicates, inconsistent formats, typos, and columns stored as the wrong type. Before any model can run, all of that has to be found and fixed, and the fixing decisions — how to handle missing data, whether to drop or impute — materially affect the results. Modelling libraries, by contrast, are mature and fast to apply once the data is clean. So the effort concentrates upstream. The figure often quoted is around 80% of time on data preparation. Practically, this is why I treat cleaning as first-class work rather than a chore to rush, because a great model on badly prepared data is worse than useless: it's confidently wrong.

The workflow is often drawn as a linear pipeline. In practice, how linear is it, and why does that matter?

Show model answer

In practice it's much more of a cycle than a straight line, and treating it as strictly linear is a common cause of failed projects. You constantly loop backward: exploration reveals the data can't answer the original question, so you return to Ask; modelling shows you need an extra signal, so you go back to Collect; cleaning surfaces a pattern worth exploring right away. Frameworks like CRISP-DM explicitly draw these backward arrows. Why it matters: if you plan a project as a one-way sequence with fixed deadlines per stage, the inevitable loops feel like failures and get suppressed, which pushes flawed assumptions downstream into the model. Planning for iteration — shorter cycles, early exploration, room to revise the question — produces more reliable results and sets honest expectations with stakeholders.

Common Mistakes to Avoid

1) Jumping straight to modelling without framing a clear question or exploring the data first. 2) Underestimating cleaning — budgeting a day for what routinely takes most of the project. 3) Treating the workflow as one-way and refusing to loop back when the data says the question was wrong. 4) Skipping the communicate stage, leaving an accurate model that no one ever acts on.

Ask the AI Tutor

Try these prompts in the AI Tutor panel: • 'Give me a business goal and quiz me on turning it into an Ask-stage question.' • 'Walk me through the workflow for a fraud-detection project.' • 'ELI5: why is the workflow a loop?' • 'List three ways the Clean stage can send you back to Collect.' • 'Interview mode: ask me to walk through a data science project end to end.'

Glossary

Workflow / lifecycle — the repeatable sequence of stages a project moves through. Ask — framing a specific, measurable question. Collect — gathering the relevant data. Clean — fixing errors, gaps, duplicates, and wrong types. EDA (Exploratory Data Analysis) — summarising and visualising data to find patterns before modelling. Model — building something that predicts or explains. Communicate — turning results into an actionable decision. CRISP-DM — a well-known industry framework that formalises this loop.

Recommended Resources

• Framework: read a short overview of CRISP-DM (Cross-Industry Standard Process for Data Mining) — the classic six-phase loop this lesson mirrors. • Book chapter: the 'data science process' chapters of 'Doing Data Science' by Schutt & O'Neil. • Reflection: pick any decision your favourite app makes and sketch the six stages behind it. • Next in DSM: you know the map — next you'll meet the tools that carry you through each stage.

Recap

✓ The workflow has six stages: Ask, Collect, Clean, Explore, Model, Communicate. ✓ Ask frames a specific, measurable question; Communicate turns the result into a decision. ✓ Collecting and cleaning data usually take the most time — often cited near 80%. ✓ Exploring (EDA) always comes before modelling — you look before you build. ✓ The workflow is a loop: findings often send you back to refine an earlier stage. Next up: Tools of the Trade. You now know the stages of a project — in the final lesson of this module you'll meet the tools that power each one, from spreadsheets and Python to SQL and version control.

scratchpad — preview this lesson's challenge anytime
order_the_workflow.pyPython
Ready
Output

Run your code to see the output here.