Kolmogorov-Smirnov Test with SciPy
📖 Scenario: You are a data analyst working with two sets of data representing customer ratings from two different stores. You want to check if these two sets of ratings come from the same distribution or not.
🎯 Goal: Build a Python program that uses the Kolmogorov-Smirnov test from SciPy to compare two data samples and print the test statistic and p-value.
📋 What You'll Learn
Create two lists of customer ratings with exact values
Import the
ks_2samp function from scipy.statsUse
ks_2samp to compare the two listsPrint the test statistic and p-value exactly as shown
💡 Why This Matters
🌍 Real World
The Kolmogorov-Smirnov test helps compare two sets of data to check if they come from the same distribution, useful in quality control and customer feedback analysis.
💼 Career
Data scientists and analysts use this test to validate assumptions about data distributions before building models or making decisions.
Progress0 / 4 steps