🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-aut...
Confused by quantiles, percentiles, or quartiles? In this hands-on tutorial, you'll learn exactly how to calculate and interpret quantiles using NumPy and Pandas in Python. Perfect for data science, statistics, and anyone analyzing numerical data!
Code: https://ryanandmattdatascience.com/py...
🚀 Hire me for Data Work: https://ryanandmattdatascience.com/da...
👨💻 Mentorships: https://ryanandmattdatascience.com/me...
📧 Email: [email protected]
🌐 Website & Blog: https://ryanandmattdatascience.com/
🖥️ Discord: / discord
📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan
📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg
🍿 WATCH NEXT
Statistics for Data Science Playlist: • Statistics for Data Science
Python Cumulative Distribution Function: • Mastering CDF (Cumulative Distribution Fun...
Python STD Variance: • How to Calculate Standard Deviation & Vari...
Python PPF: • Python PPF Explained: Understanding Probab...
In this video, I walk you through how to calculate quartiles, deciles, and percentiles in Python using both NumPy and Pandas. We start by breaking down what quantiles actually are and how these three types of data points help you understand data distribution. I explain the key differences between quartiles (dividing data into four parts), deciles (ten parts), and percentiles (one hundred parts), with real examples showing how the median can be represented as Q2, D5, or P50.
Then we jump into practical Python coding examples. I show you how to use NumPy's percentile function and Pandas' quantile method to calculate these values on real datasets. We work through multiple examples for each type of quantile, and I demonstrate a helpful Pandas shortcut that lets you calculate multiple quantiles at once by passing in a list of values. By the end of this tutorial, you'll understand exactly when to use each type of quantile and how to implement them efficiently in your own data analysis projects.
Whether you're working on data science projects, statistical analysis, or just want to better understand data distribution, this video covers everything you need to know about quartiles, deciles, and percentiles in Python.
TIMESTAMPS
00:00 Introduction to Quantiles
00:22 Understanding Quartiles, Deciles, and Percentiles
01:04 Defining Quartiles (Q1, Q2, Q3)
01:28 Understanding Deciles
01:47 Understanding Percentiles
02:00 Examples with Sample Data
03:11 Setting Up Python Environment
03:40 Creating the Data List
03:55 Example 1: Calculating Quartiles in NumPy
04:51 Example 2: Calculating Deciles in NumPy
05:30 Example 3: Calculating Percentiles in NumPy
06:12 Example 4: Quartiles with Pandas DataFrame
07:24 Example 5: Deciles with Pandas
08:24 Example 6: Percentiles with Pandas
09:08 Example 7: Pandas Shortcut for Multiple Quantiles
10:10 Key Differences: NumPy vs Pandas
10:50 Recap and Final Tips
OTHER SOCIALS:
Ryan’s LinkedIn: / ryan-p-nolan
Matt’s LinkedIn: / matt-payne-ceo
Twitter/X: https://x.com/RyanMattDS
Who is Ryan
Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF.
Who is Matt
Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One.
*This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.