Meet the hardest functions of Pandas

Meet the hardest functions of Pandas

Meet the hardest functions of Pandas. In this post, I teach you how to use crosstab() and the cases where you choose it over other similar functions.

Introduction

I remember myself enjoying a course named “Intermediate Data Visualization with Seaborn” on DataCamp. It was teaching pretty awesome plots and methods for DV. When it came to heatmaps, the instructor, out of nowhere introduced a completely new pandas function crosstab(). Then, quickly said: "crosstab() is a useful function that calculates cross-tabulation tables..."

I was lost right there. Obviously, my first instinct was to check out the documentation for the function. I was just starting to feel that I could handle any documentation after Matplotlib’s, and… I was wrong. Even the examples were given on numpy arrays while I was supposed to create heatmaps using the damn function🤦‍♂️.

After I had my practice on it, I knew that this was something that others would struggle too. So, here I am writing a whole article on it.

In the last part of this article, I talked about why some courses don’t teach you advanced functions like crosstab(). It is simply hard to create the context such functions will be useful in, while keeping the level of examples to beginner. Besides, most courses use small or toy datasets. The benefit of such functions is more pronounced in more complex data science environments and often used by more experienced pandas users.

In this post, I teach you how to use crosstab() and the cases where you choose it over other similar functions. Enjoy!

Clickable Table of Contents (web-only)

∘ Introduction

∘ Setup

∘ Pandas crosstab(), the basics

∘ Pandas crosstab() comparison with pivot_table() and groupby()

∘ Pandas crosstab(), customizing even further

∘ Pandas crosstab(), multiple groupings

You can download the notebook of this article on [this_](https://github.com/BexTuychiev/medium_stories/tree/master/hardest_of_pandas2) GitHub repo._

artificial-intelligence machine-learning programming python data-science

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.