Sub topic 1
What a cohort is and why retention matters for fit
Prerequisites.
Assume you know active users, churn, and basic tables. You should also be comfortable reading a line chart. The Python example uses pandas, a library for working with tabular data.
Cohorts connect first use to later behavior
A cohort is a group of users who share a meaningful starting point. For retention analysis, that point is usually the month or week of a user's first successful use.
Retention asks: What percentage of a starting cohort is still performing the product's core activity later? A product with strong product-market fit usually keeps a meaningful share of users active after the initial trial. A large signup count without repeat use is weaker evidence.
Choose the activity event and time unit
Count an event that represents delivered value, not a superficial action such as opening an email. For a collaboration product, “completed a shared task” may be better than “logged in.” Define the event before calculating retention.
Choose a time unit that matches the product's natural use:
- Daily for products used every day.
- Weekly for products used several times per week.
- Monthly for products with longer workflows.
The starting cohort size is the denominator. If 100 users start in January and 35 complete the core activity in February, month-one retention is 35%.
Classic, bracket, and rolling retention
| Definition | What counts as retained | Useful for |
|---|---|---|
| Classic N-day | Activity on the exact Nth day | Daily products with predictable use |
| Bracket | Activity within a period, such as days 1–7 | Products with irregular schedules |
| Rolling | Activity on or after day N | Products where late return still matters |
State the definition in every report. “Day 30 retention” can produce different answers under each method.
Build a cohort retention table
Assign each event to the user's first-use cohort. Then calculate the user's age in periods and count distinct active users.
import pandas as pd
events = pd.DataFrame({
"user": [1, 1, 2, 2, 3],
"month": pd.to_datetime([
"2026-01-05", "2026-02-10", "2026-01-20",
"2026-02-15", "2026-02-02"
]).to_period("M")
})
events["cohort"] = events.groupby("user")["month"].transform("min")
events["age"] = (events["month"].astype(int)
- events["cohort"].astype(int))
active = events.groupby(["cohort", "age"])["user"].nunique().unstack(fill_value=0)
retention = active.div(active[0], axis=0)
print(retention.round(2))The result has one row per cohort and one column per age. Compare cohorts at the same age, and leave future, unobserved periods blank rather than treating them as zero.
Exercise
A weekly product has 80 users in a March cohort. Forty complete the core action during week 2. What is bracket week-2 retention?
Show answer
50%, because 40 divided by 80 equals 0.50.