Python Pandas Tutorial 12. Stack Unstack

preview_player
Показать описание
Pandas stack method is used to transpose innermost level of columns in a dataframe. unstack() is used to perform a reverse operation. This tutorial explains stack/unstack using nice visualizations.

Topics that are covered in this Python Pandas Video:
0:00 What is stack
1:32 How to use stack() method
2:18 Pandas stack documentation
3:03 Perform unstack() method

Next Video:

Popular Playlist:

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

To get rid of "Unnamed: 0_level_0" in a column:
df = pd.read_excel('./stocks.xlsx', header=[0, 1], index_col=[0])

msgrz
Автор

Machine learning tutorials with exercises:

codebasics
Автор

Machine learning tutorials with exercises are available at:

codebasics
Автор

Thanks for helping. Videos are really informative!!!

gouravchatterjee
Автор

thanks sir....best way to giving training

rajsamant
Автор

Straightforward, clear, and very informative. Thank You.

ARROBACOMPUTERS
Автор

But why "Unnamed: 0_level_0" is appearing even though it is not exist in the excel sheet

MrPrudhvisai
Автор

I had a whole column with string input, it does not show that in the df.stack() output. Why does it leave the entire row ?
Somebody plz help.

wackybaccygaming
Автор

Hello, I would like to arrange my pivot table the same way your data frame started out e.g. (Year Quarter across the top, type underneath and member IDs replacing company dates)- is that possible?

jakeg
Автор

Hi how to pivot multiple columns in python pandas? For example I have 9 columns and I want to retain columns 1 to 3 and pivot the columns from 4 to 9.

marlonmag-isa
Автор

Hi, can you please provide some practice questions as well so we can solve those problems to do hands-on . Really liked your videos.

shahrohit
Автор

Hello thanks for the video …

I will like to know how can we apply this function in the real world ? It answers to what type of problem ?

cococnk
Автор

hello sir, i like your tutorials on pandas very much . i have a one question that is 'how to make box of output ?', whenever you run the cell and coming output in box but in my situation its not happend.

akshaykharat
Автор

i beg you sir please tell about Web Crawler and how to make it in simple step

achin
Автор

I get an error : excel xlsx file; not supported when I try to import excel file

just_random_stuffs
Автор

sir what is the meaning of if we use header=0 which skips first row treats second row as header.. and how to access that dataframe...

Ganeshpatil-owej
Автор

my first row is showing two times please check this screenshot :


i wrote first row one time please check screenshot of my excel file too:


and screenshot of my code is below:

haider