#70 Pandas (Part 47): GroupBy - 7: Enumerate, plot group, and pipe in Python | Tutorial

preview_player
Показать описание
The video discusses methods to enumerate groups, plot groups and use pipe in Pandas in Python.

Timeline
(Python 3.7)

00:00 - Welcome
00:11 - Outline of video
00:34 - Open Jupyter notebook
00:43 - Data
01:18 - Enumerate: explanation
01:44 - GroupBy: Enumerate: cumulative count: .cumcount()
03:20 - GroupBy: Enumerate: cumulative count: .cumcount(ascending=False)
04:24 - GroupBy: Enumerate: ngroup()
05:30 - GroupBy: Enumerate: ngroup(ascending=False)
06:15 - Import library: Matplotlib
06:38 - GroupBy: Plot: .boxplot()
08:26 - Intuition of how .pipe() works?
08:57 - Create a Series
09:14 - Create custom functions
09:38 - Pipe: .pipe(): Explanation
10:55 - GroupBy: Pipe: .pipe(): using lambda function
12:17 - GroupBy: Create grouped object
12:24 - GroupBy: Pipe: .pipe(): .sum()
12:40 - GroupBy: Pipe: .pipe(): Rearrange output: .unstack()
13:35 - Create custom function
14:22 - GroupBy: Create grouped object
14:58 - GroupBy: Pipe: .pipe()
15:28 - GroupBy: Pipe: .pipe(): Rearrange output: .unstack()
15:47 - Ending notes

#################
# Data
#################

df = pd.DataFrame({
'fruits': ['mango','mango','orange','orange','banana', 'mango', 'orange','banana', 'banana'],
'grade': ['A','B','A','A','B', 'A','B','A','A'],
'q':[1,2,1,1,2,1,2,1,2],
'price': [10,12,7,9,3,1,2,11,13],
'quantity':[11,2,3,4,5,3,9,3,4],
})

#################
Рекомендации по теме