Join Jonathan Fernandes for an in-depth discussion in this video Solution, part of pandas Essential Training.
- [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 Olympics.…
For each country, include the year…
- Working with plots
- Boolean indexing
- String handling
- Grouping data
- Creating your own colormaps
Skill Level Intermediate
1. Technical Setup
2. Series and DataFrames
3. Data Input and Validation
4. Basic Analysis
5. Basic Plotting
9. Data Visualizations
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.