← Back to the case study

Code: Which leads become customers, and how fast?

Every number on the case study page comes from these files. View any file in the browser, download one, or get them all as a zip.

FileWhat it doesOpen
analysis.pyJoins leads to won deals, counts the funnel by source, the close-time curve and customers per rep, and builds the forecast. Writes results.json.View · Download (5.3 KB)
results.jsonEvery number on the page.View · Download (5.0 KB)

Download all (sales-funnel.zip)

Run it yourself

  1. Download the two CSV files of the Olist Marketing Funnel data set (Kaggle) into a folder named data/.
  2. pip install pandas
  3. python3 analysis.py

Data: Olist Marketing Funnel (Kaggle, CC BY-NC-SA 4.0): 8,000 leads, 842 won deals. The data files are not re-hosted here; the links go to the original source.