How to Reshape Dataframes | Pivot, Stack, Melt and More

  Рет қаралды 23,421

Mısra Turp

Mısra Turp

Күн бұрын

When working with datasets you will need to change the shape and the perspective of the data. This is done sometimes for analysis purposes and sometimes just to explore the data a bit better. In this video, we learn 8 ways to change the shape of the dataframe we are working with to gain a new perspective on it. The functions we learn are:
1. pivot
2. pivot_table
3. Stack
4. Unstack
5. Melt
6. Groupby
7. Crosstab
8. Explode
Find the code here: github.com/misraturp/Pandas-d...
RESOURCES:
🏃‍♀️ Data Science Kick-starter mini-course: www.misraturp.com/courses/dat...
🐼 Pandas cheat sheet: misraturp.gumroad.com/l/pandascs
📥 Streamlit template: misraturp.gumroad.com/l/stemp
📝 NNs hyperparameters cheat sheet: www.misraturp.com/nn-hyperpar...
📙 Fundamentals of Deep Learning in 25 pages: misraturp.gumroad.com/l/fdl
COURSES:
👩‍💻 Hands-on Data Science: Complete your first portfolio project: www.misraturp.com/hods
🌎 Website - misraturp.com/
🐥 Twitter - / misraturp
00:00 Introduction
00:42 Pivot
02:12 Pivot_table
04:24 Stack
05:45 Unstack
06:22 Melt
07:53 Groupby
09:22 Crosstab
10:36 Explode
12:03 Download the Pandas Cheat Sheet!

Пікірлер: 41
@misraturp
@misraturp Жыл бұрын
👉 All you need to know about Pandas in one place! Download my Pandas Cheat Sheet (free) misraturp.gumroad.com/l/pandascs
@uptoolate1896
@uptoolate1896 Жыл бұрын
Your pandas cheat sheet is WAY more understandable (to me, at least) than the official one in the pandas documentation. Thanks for making it!
@misraturp
@misraturp Жыл бұрын
That's great to hear!
@jonortiz81
@jonortiz81 Жыл бұрын
For quite some time twitter hadn't recommended anything really interesting and valuable to watch. Nice video, I'm totally hooked to your content. 💪
@misraturp
@misraturp Жыл бұрын
That's amazing to hear, thank you John!
@simple-stack-by-ed
@simple-stack-by-ed 2 ай бұрын
Straightforward explanation of pivot. Like earned!. Thx
@tanishq6352
@tanishq6352 Жыл бұрын
great video thanks for making my doubts clear of explode function and crosstab
@misraturp
@misraturp Жыл бұрын
You're very welcome :)
@josep_pacheco
@josep_pacheco Жыл бұрын
Excelente contenido Misra, gracias : )
@misraturp
@misraturp Жыл бұрын
De nada!
@jerrymarq3897
@jerrymarq3897 11 ай бұрын
Good stuff I was trying to figure how to do counts by group. And that is the cross tab.
@kevon217
@kevon217 Жыл бұрын
Great overview!
@misraturp
@misraturp Жыл бұрын
Thanks!
@jugurthasemai727
@jugurthasemai727 Жыл бұрын
Great job, thanks for this sharing, you're giving energy too ;-)
@misraturp
@misraturp Жыл бұрын
Thank you! 😀
@Hamza12123
@Hamza12123 6 ай бұрын
very useful , thank you ma'am
@akhilp6263
@akhilp6263 Жыл бұрын
very useful.Thank you
@misraturp
@misraturp Жыл бұрын
You're very welcome :)
@mjacfardk
@mjacfardk Жыл бұрын
Thank you very much, for your valuable efforts, I don't know how to thank you, anyway thank you always. Please make us groupby tutorial and how to compare it with pivot tables 🙏
@misraturp
@misraturp Жыл бұрын
You are very welcome! The groupby video is on the way!
@PeterPankowski
@PeterPankowski 6 ай бұрын
Very nice
@JayLim-bn9fh
@JayLim-bn9fh 3 күн бұрын
Thanks I just subbed
@GregThatcher
@GregThatcher 2 ай бұрын
Thanks!
@misraturp
@misraturp 2 ай бұрын
Thank you Greg! Really appreciate your support!
@am0x01
@am0x01 11 ай бұрын
I’m in love
@automatewithamit
@automatewithamit 3 ай бұрын
Thanks for your Video ! Can you please let me know if we can put those collapse and expand functionality in actually generated pivot table in excel using python ??
@arpeshmistry6550
@arpeshmistry6550 10 ай бұрын
Nice tutorial on pivot. I have one query, is there any way we can create the data-link in pivot like we do in excel. Pls help
@viniciusoviedo
@viniciusoviedo Жыл бұрын
Awesome content...Thanks for sharing it! Which screen recorder do you use? I really like it. Best!
@misraturp
@misraturp Жыл бұрын
Thank you Vinícius! I use ScreenFlow.
@ericliu3366
@ericliu3366 7 ай бұрын
Hi I like your videos. BTW, how you get the Juypter to have output horizontal scrollable. My Anaconda Juypter cannot.😊
@aakashniture
@aakashniture 4 ай бұрын
Hi Misra, amazing video. I have a doubt. I performed pivot_table() and after getting new columns.. I am not able to select those new columns or save one new column in new df. E.g. in above video after pivoting you got A, B, C as new columns.. i can not select df['A']? It gives error. When i do df.shape() it shows A, B, C as columns. Please help.
@sanooosai
@sanooosai Жыл бұрын
great tutorial, Eva mendes look like you
@misraturp
@misraturp Жыл бұрын
Haha thanks!
@jianlinchen7978
@jianlinchen7978 4 ай бұрын
pandas looks a little bit complex than power query. ... So what is pandas's strength?
@pomme_paille
@pomme_paille Жыл бұрын
I'm confused at the difference between stack and melt 😅
@hedeyhod
@hedeyhod Жыл бұрын
I think it's hard to understand for beginners. especially melt function. maybe you should slow down when you explain examples. thank you so much for tutorial.
@misraturp
@misraturp Жыл бұрын
You're welcome
@bay-bicerdover
@bay-bicerdover Жыл бұрын
hold the pace
@johnspivack6520
@johnspivack6520 Жыл бұрын
Thanks for the video. Brilliant person, but why talk so fast? I had to stop it about a twenty times and puzzle out what was being said. After I did, it made sense, but why not slow down to a more comfortable pace? By the way, 'SVCS' means 'Services', isn't it obvious from the context?
@bay-bicerdover
@bay-bicerdover Жыл бұрын
FAST X
Pandas fundamentals every data scientist needs to know - Part 1
4:52
Pandas functions: merge vs. join vs. concat
16:15
Mısra Turp
Рет қаралды 24 М.
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 19 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 26 МЛН
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 6 МЛН
How to use the Pandas GroupBy function | Pandas tutorial
19:03
Mısra Turp
Рет қаралды 28 М.
Stack, Unstack, Melt, Pivot - Pandas
10:23
Data Talks
Рет қаралды 39 М.
Using Data Visualization to Identify Data Problems
12:27
Mısra Turp
Рет қаралды 1,9 М.
Pandas Functions: Apply vs. Map vs. Applymap
11:53
Mısra Turp
Рет қаралды 24 М.
Pandas Functions: Three Ways to Use the Apply Function
12:11
Mısra Turp
Рет қаралды 18 М.
Pivot tables with Pandas
9:00
Python and Pandas with Reuven Lerner
Рет қаралды 36 М.
Gizli Apple Watch Özelliği😱
0:14
Safak Novruz
Рет қаралды 4,5 МЛН
Телефон в воде 🤯
0:28
FATA MORGANA
Рет қаралды 1,2 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,3 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,3 МЛН