Skip to content

samirsaci/lss-chi-squared

Repository files navigation

Lean Six Sigma with Python — Chi-Squared Test 👷

How to replace Minitab with Python to perform a Chi-Squared Test to explain a shortage of drivers impacting your transportation network

Lean Six Sigma (LSS) is a step-by-step approach to process improvement. This approach usually follows five steps (Define, Measure, Analyse, Improve and Control) for improving existing process problems with unknown causes.

Youtube Video

Find in the link below a short animated video to explain the concept behind this solution

Explainer Video Link

Article

In this Article, we will explore how Python can replace Minitab (Software widely used by LSS experts) in the Analysis step to test hypotheses and understand what could improve the performance metrics of a specific process.

Scenario

You are the Inbound Transportation Manager of a small factory in the United States. Your transportation network is simple; you have two routes:

  • Route 1: coming from your northern regional hub (with difficult road conditions and heavy traffic)
  • Route 2: coming from your southern regional hub (with no traffic and a beautiful modern road)

Transportation is managed by an external service provider with a fleet of three trucks (with three different drivers: D1, D2, D3).

Problem

When an order is allocated to the northern regional hub, the lead time to get the request accepted is 35% higher than the southern hub.

Question

Are there drivers avoiding being allocated to the north route as much as possible?

Experiment

We have analysed the shipments of the last 18 months to build a sample of 269 records.

Code

In this repository, you will find all the code used to explain the concepts presented in the article.

Files

  • Chi-Squared Test.ipynb - Jupyter notebook with step-by-step analysis
  • chi_squared_test.py - Standalone Python script
  • data/ - Folder containing input data (df_hub.xlsx)

Getting Started

pip install -r requirements.txt
python chi_squared_test.py

Dependencies

  • pandas
  • matplotlib
  • scipy
  • openpyxl

About me 🤓

Senior Supply Chain and Data Science consultant with international experience working on Logistics and Transportation operations.
For consulting or advising on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.
Please have a look at my personal blog: Personal Website