Pandas Crosstab Tutorial | Python Pandas Tutorial #7 | Aggfunc, Margins, Normalize Data

preview_player
Показать описание
Pandas crosstabs (cross tabulations) are frequency distributions of two or more variables. Learn how to create crosstabs with Python and Pandas, including how to normalize your data to calculate row and column percentages.

Crosstabs are also known as contingency tables.

0:00 Introduction
0:26 Differences to Pandas Pivot Table Function
1:50 Pandas Crosstab
2:59 Pandas Crosstab Aggfunc
4:15 Changing Pandas Crosstab Names (colnames, rownames )
5:07 Multiple Indexes Pandas Crosstabs
7:03 Multiple Columns in Pandas Crosstabs
7:55 Changing Multiple Row and Column Names
8:49 Pandas Crosstab Normalize Results
10:21 Pandas Crosstab Margins / Totals
11:53 Challenge and Conclusion

Learn Python programming the right way!

----------------------------------------------------------

✅ Follow me on other platforms:
Рекомендации по теме
Комментарии
Автор

More really great content, thanks for the videos! And I really appreciate the detailed chapters and everything in the description, it is super helpful.

DrSpacemann
Автор

🎉🎉🎉 This is exactly what I It's so easy to use this. I've been searching for hours to try and find this exact video.

samiam.
Автор

Good job! Thanks! Your explanation is great!

DzmitryYashyn
Автор

God Bless u my friend! way to go and keep up the good work

majddabour
Автор

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 ??

automatewithamit
Автор

Can you define normalize separately for rows and columns, say I want numbers in the columns total and percentages in the row totals?

aalb
Автор

Just stumbled upon your channel whilst on my Python / Panda's journey.

Would like to say that your content is explained really well, you've definitely tailored the best perspective from a viewer and I'll be working through all your content to better my knowledge :)

I have a question/issue with Sorting.
If I have 2 index's and then are sorting by the column margin, on my output it duplicates the indices and mixes around the sub-index's.
Is there a way to sort by margin but keep the first index set in place so that only the sub-index's re-arrange based on their margin?

samrogers
Автор

hi! this's a great video! One question, are we able to calculate two different cross tables? If we had the same number of index and columns, I want to multiply one to another for further analysis. Or do we need to convert it back to a dataframe and somehow calculate...?

AB-nksq
Автор

Is it? pd.crosstab(df.Region, df.Type, margins=True, margins_name='All Clothing Types', normalize='columns')

nonitathomas
Автор

Hi, Thank you for this series. I can't tell how much it has helped me in my learning of pandas so far. One question : what's differnence in using the 'parse_dates' options compared to using the datetime function to convert strings to date format

tridibbiswas
Автор

Hi! How do I change the order of the row/column names? Instead of alphabetically (East, North, South, West), I would like it to be North, South, East, West, please?

fiqhonomics
Автор

What should we code if we want to delete children column and have other two men and women column in table?

henrikdickens
Автор

Hi, is the answer pd.crosstab(df.Region, df.Type, normalize = 'columns', margins = True, margins_name = 'All clothing types') ?

varvaramineeva
Автор

please who knows how to calculate the conditional variance

aminaabdelhedi
Автор

Is it? pd.crosstab(df.Region, df.Type, margins=True, margins_name='All Clothing Types', normalize='columns')

IsItBehindTheFridge