RFM Analysis

Python script (and IPython notebook) to perform RFM analysis from customer purchase history data

Digital Marketing & SEOJupyter NotebookApache-2.0

Abstract

RFM Analysis is an open-source Digital Marketing & SEO project. Python script (and IPython notebook) to perform RFM analysis from customer purchase history data. RFM analysis is a simple python script (and IPython notebook) to perform RFM analysis from customer purchase history data. Please read the blog post on RFM analysis, it includes instructions on how to make RFM analysis actionable and a ready to use Tableau dashboard. It is built using Jupyter Notebook. The complete source code is publicly available on GitHub under the Apache License 2.0, making it a useful reference for students building a Digital Marketing & SEO mini project or final-year project.

1. Introduction

RFM analysis is a simple python script (and IPython notebook) to perform RFM analysis from customer purchase history data. Please read the blog post on RFM analysis, it includes instructions on how to make RFM analysis actionable and a ready to use Tableau dashboard.

2. Objective

Python script (and IPython notebook) to perform RFM analysis from customer purchase history data

This project demonstrates how Jupyter Notebook can be applied to a real-world Digital Marketing & SEO problem.

4. Technology Stack

Jupyter Notebook

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later with Jupyter Notebook / JupyterLab (or Google Colab)
  • pip for dependencies
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/joaolcorreia/RFM-analysis.git
cd RFM-analysis
  1. orders file (-i sample-orders.csv)
  2. output file with the RFM segmentation (-o rfm-segmenta.csv)
  3. maximum date of your orders table (-d “YYYY-mm-dd”).
$ python RFM-analysis.py -i sample-orders.csv -o rfm-segments.csv -d "2014-04-01"

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Export reports to Google Sheets or PDF
  • Schedule weekly automated reports
  • Add competitor comparison

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. Which marketing or SEO problem does this tool solve?
  2. Which data sources or APIs does it use (Search Console, Analytics, social platforms)?
  3. Which metrics or KPIs does it report and how are they calculated?
  4. How could the output help a business make decisions?
  5. How would you schedule it to run automatically?

9. Source Code & License

This project is developed by joaolcorreia and published on GitHub under the Apache License 2.0. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on a Digital Marketing & SEO project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Digital Marketing & SEO Internship