How to Rank() Your Data In Python Pandas [Part 1] @stratascratch
How to Rank() Your Data In Python Pandas [Part 1]  @stratascratch
Uploaded April 2023 | Updated November 2026, 2 days ago
In this video, we will explore different ranking methods in Python for data analysis. We start with a simple exercise from Airbnb where we rank guests based on their ages in descending order. Then, we discuss the different ways to handle ties in ranking, including the default option that gives the same rank to tie groups under the average method, and the minimum and maximum methods that use the minimum and maximum rank for tie groups, respectively. Finally, we introduce the dense ranking method that assigns consecutive ranks with no gaps regardless of how many entities are tied for a rank. We apply these methods to different problems, including ranking cities by the most five-star businesses and hosts by the most number of beds listed, and compare the results of each method.


πŸ‘‰ Check out next video for more:
Data Ranking: Python Pandas and SQL Equivalents [Part 2]: youtu.be/Cg66PLiW9L0


πŸ§‘β€πŸ’» Go to the questions through the links below and follow along with us:

πŸ“Œ Question1: platform.stratascratch.com/coding/10160-rank-guests-based-on-their-ages?code_type=2&utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking
πŸ“Œ Question 2: platform.stratascratch.com/coding/10148-find-the-top-10-cities-with-the-most-5-star-businesses?code_type=2&utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking
πŸ“Œ Question 3: platform.stratascratch.com/coding/10161-ranking-hosts-by-beds?code_type=2&utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking
πŸ“Œ Question 4: platform.stratascratch.com/coding/10351-activity-rank?code_type=2&utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking

______________________________________________________________________

πŸ‘‰ Subscribe to my channel: bit.ly/2GsFxmA
πŸ‘‰ Playlist for more data science interview questions and answers: bit.ly/3jifw81
πŸ‘‰ Playlist for data science interview tips: bit.ly/2G5hNoJ
πŸ‘‰ Playlist for data science projects: bit.ly/StrataScratchProjectsYouTube
πŸ‘‰ Practice more real data science interview questions: platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking

______________________________________________________________________

Timeline:

Intro: (0:00​​​)
Rank guests based on their ages (0:23)
Find the top 5 cities with the most 5 star businesses (2:09)
Ranking Hosts by beds (4:28)
Activity Rank (6:31)
Conclusion: (​8:10)

______________________________________________________________________

About The Platform:

I'm using StrataScratch (platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking), a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.

So, if you want more interview practice with real data science interview questions, visit platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+python+ranking. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.

______________________________________________________________________

Contact:

If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com

_______________________________________________________________________
#pandaspythontutorial #pythondatascience #pythoninterviewquestion
How to Rank() Your Data In Python Pandas [Part 1]SQL Syntax Best Practices: How to Structure Your SQL CodeHow To Be a Lazy Data Scientist With AI Chrome ExtensionsExploring Decision Tree and Random Forest Classifiers | Machine Learning AlgorithmsData Science is Dead. Again.Is SQL Really the ONLY Language You Need for Data Science?Framework to Solve Noom Advanced SQL Interview QuestionDating Your Data Science Team - things to look for when working on a teamHow to Solve a Forbes Interview Question Using the Sample() FunctionImporting a Pandas Dataframe to a Database in Python [For Your Data Science Project]The AI Boom Is a Ponzi Scheme(Part 3) How to Formulate the Approach for Solving SQL Interview Questions
StrataScratch |

How to Rank() Your Data In Python Pandas [Part 1]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER