Join Jonathan Fernandes for an in-depth discussion in this video Iterate through a group, part of pandas Essential Training.
- [Narrator] We can iterate through groups.…As we mentioned earlier,…each of these groups are data frames.…What we can do here, is to print out the key…and then print out the rows corresponding to that key.…As an example, on the olympics dataset we are working on,…if we group by each olympic here,…then the key would be the olympic edition or year,…and the group portion would be…all of the rows corresponding to that edition.…Then Groupby prints the next olympic edition,…followed by all of the rows corresponding to that edition.…Let's take a look in our Jupyter notebook.…
So what we want to do here is to look…through the Groupby object,…for group key…group value in,…and then a Groupby object…which is Edition in this case, we are grouping by edition.…This is just a very simple Python script.…I want to print the group key…and I want to print the group value.…
And I change that to value,…and the group value…and let's run this.…And basically what we see here…is what we saw in the list command earlier,…so this is the key, which is the edition,…
- 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.