How to Reshape Dataframes | Pivot, Stack, Melt and More
HTML-код
- Опубликовано: 2 июл 2024
- 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! - Наука
👉 All you need to know about Pandas in one place!
Download my Pandas Cheat Sheet (free)
misraturp.gumroad.com/l/pandascs
Your pandas cheat sheet is WAY more understandable (to me, at least) than the official one in the pandas documentation. Thanks for making it!
That's great to hear!
Straightforward explanation of pivot. Like earned!. Thx
For quite some time twitter hadn't recommended anything really interesting and valuable to watch. Nice video, I'm totally hooked to your content. 💪
That's amazing to hear, thank you John!
Good stuff I was trying to figure how to do counts by group. And that is the cross tab.
Excelente contenido Misra, gracias : )
De nada!
great video thanks for making my doubts clear of explode function and crosstab
You're very welcome :)
very useful , thank you ma'am
Great overview!
Thanks!
Great job, thanks for this sharing, you're giving energy too ;-)
Thank you! 😀
Thanks I just subbed
Very nice
very useful.Thank you
You're very welcome :)
I’m in love
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 🙏
You are very welcome! The groupby video is on the way!
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 ??
Thanks!
Thank you Greg! Really appreciate your support!
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
Hi I like your videos. BTW, how you get the Juypter to have output horizontal scrollable. My Anaconda Juypter cannot.😊
Awesome content...Thanks for sharing it!
Which screen recorder do you use? I really like it. Best!
Thank you Vinícius! I use ScreenFlow.
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.
great tutorial, Eva mendes look like you
Haha thanks!
pandas looks a little bit complex than power query. ... So what is pandas's strength?
I'm confused at the difference between stack and melt 😅
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.
You're welcome
hold the pace
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?
FAST X