When should I use a "groupby" in pandas?

Опубликовано: 28 Сентябрь 2024
на канале: Data School
245,014
6k

The pandas "groupby" method allows you to split a DataFrame into groups, apply a function to each group independently, and then combine the results back together. This is called the "split-apply-combine" pattern, and is a powerful tool for analyzing data across different categories. In this video, I'll explain when you should use a groupby and then demonstrate its flexibility using four different examples.

SUBSCRIBE to learn data science with Python:
https://www.youtube.com/dataschool?su...

JOIN the "Data School Insiders" community and receive exclusive rewards:
  / dataschool  

== RESOURCES ==
GitHub repository for the series: https://github.com/justmarkham/pandas...
"groupby" documentation: http://pandas.pydata.org/pandas-docs/...
"agg" documentation: http://pandas.pydata.org/pandas-docs/...
"plot" documentation: http://pandas.pydata.org/pandas-docs/...

== LET'S CONNECT! ==
Newsletter: https://www.dataschool.io/subscribe/
Twitter:   / justmarkham  
Facebook:   / datascienceschool  
LinkedIn:   / justmarkham