By MCP Analytics Team | Published , updated
One row per customer is a different problem from one row per customer per month. The shape of the file narrows which methods can apply to it.
The analyses filed under this data shape. Each card opens the analysis page, where you can run it on a file.
The data. standard_survival_v2.csv, the published sample file for Survival analysis: 600 rows; columns customer_id, plan, months_active, churned, signup_region. Sample data, not a customer's.
The calculation. Python, standard library only. This exact code ran against the file when this page was built, and printed the output below it.
import csv
rows = list(csv.DictReader(open("standard_survival_v2.csv")))
data = [(float(r["months_active"]), int(r["churned"])) for r in rows]
at_risk, s, median = len(data), 1.0, None
for t in sorted({t for t, _ in data}):
ended = sum(1 for u, e in data if u == t and e == 1)
s *= 1 - ended / at_risk # Kaplan-Meier step
if median is None and s <= 0.5:
median = t
at_risk -= sum(1 for u, _ in data if u == t)
churned = [u for u, e in data if e == 1]
print(len(data), "customers,", len(churned), "churned,",
len(data) - len(churned), "still active")
print("Kaplan-Meier median months to churn:", median)
print("naive mean over churners only:",
round(sum(churned) / len(churned), 1))
600 customers, 433 churned, 167 still active
Kaplan-Meier median months to churn: 18.22
naive mean over churners only: 14.1
What it says. Half of customers are estimated to have churned by month 18.22. Averaging only the customers who already left gives 14.1 months, which is too short: it ignores the 167 who are still active and have already lasted that long. Kaplan-Meier counts them for as long as they were watched.
What it does not say. The median assumes customers still active are as likely to leave later as similar customers who left. It describes this file only; the library analysis compares plans with a Cox model and checks that its proportional-hazards assumption holds.
Run Survival analysis on this file or your own, or open its stored sample report.
Further reading on the method in the worked example. Each reference was looked up and its authors, title, year and venue confirmed on 27 October 2026.
The stored sample report for Survival analysis. Each analysis has its own report layout; open its page to see what it returns.
Tell us what went wrong, in your own words. We capture the page you're on automatically, so no need to describe where you are.