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.

Solution

Solution - pandas Tutorial

From the course: pandas Essential Training

Start my 1-month free trial

Solution

- [Instructor] So, let's import Pandas and read the CSV file into our DataFrame 00. So, using Groupby, plot the total number of medal awarded at each of the Olympic Games throughout history. So, this is the same question that we looked at in the indexing challenge and here's another way to get the same result using Groupby. So, 00's my DataFrame. I'm going to Groupby the edition and I'm going to use the size object to determine the count for each group and let's see what we get here. So, unlike in indexing, we see that Groupby sorts the index by default and so, we can see it's 1896 to 1900 and so on and all of the years here are sorted by the Olympic year, so we don't have to use these sort index like we had to in the indexing example. So, all I need to do now is to just plot this line and we end up with exactly the same result as we did in the indexing challenge. Onto the next question. Create a list showing the total number of medals, one for each country over the history of the…

Contents