# 22. Pandas Pivot, stack, unstack in Python - 10 | Tutorial

preview_player
Показать описание
The video discusses pivot, stack and unstack in Python.

Timeline & Exercise
(Python 3.7)

00:00 - Welcome
00:09 - Outline of video
00:26 - What is pivot? why pivot?
02:10 - ——————— Correction. Here I meant to say “… the table on the left …”
04:36 - Open Jupyter Notebook
04:49 - Data
08:51 - Pivot: df with 4-columns
12:28 - Get subset of a pivoted DataFrame
12:46 - Stack
13:46 - ——————— Correction. Here I meant to say “… collapsed these four columns …”
14:52 - Unstack
16:13 - Unstack - by level 0
16:57 - Unstack - by level 1
17:39 - Unstack - by level 2
18:30 - Unstack - by index column name
19:20 - Sorting during stack/unstack
20:40 - Unstack/stack - 3-levels of row index
25:45 - Unstack/stack - 2-levels of row index AND 2-levels of column index
27:07 - Subset by row-indexes of multi-indexed DataFrame
30:47 - Subset by row and column indexes of a multi-indexed DataFrame
32:08 - Unstack the subset of DataFrame
33:20 - Pivot table - .pivot_table()
34:07 - Why .pivot() won’t work with duplicate index combinations?
35:17 - Why use .pivot_table()? Use aggregate function.
36:52 - Ending notes

learndataa exercise for this video can be found at link below:

Thank you
Рекомендации по теме
Комментарии
Автор

Thank you so much, I've been struggling with this all day! Very clear at the beginning with the tables/visuals.

sushimouse