From the course: pandas Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Learning heatmaps

Learning heatmaps - pandas Tutorial

From the course: pandas Essential Training

Start my 1-month free trial

Learning heatmaps

- [Instructor] Data Visualizations. Using the Olympic data set we have used so far in this course, let's say you wanted to present a summary of the total medals won by participating countries in the 2008 Beijing Olympics. Which of these two do you find more intuitive and readable? I hope you'll agree with me that the heatmap is far more intuitive and helpful. Let's look to see how we can create these in our Jupiter Notebook. Because we're going to be using Seaborn, let's import Seaborn as sns. What we want here are all the medals won in the 2008 Olympics. So, oo.Edition equals 2008. Let's store that in the data frame Last Olympics. Now we have in our data frame LO, all of the medals won by the athletes in the 2008 Beijing Olympics. I want to group by the countries, which is the NOC, and the medals won. I do a size off of that. We can see that we've got a group by object sorted alphabetically by the different countries and the medals won. Let's unstack this with medal, and we'll fill…

Contents