Join Jonathan Fernandes for an in-depth discussion in this video Using sort_index(), part of pandas Essential Training.
- [Instructor] Now I want to sort index.…Sort index allows for all the items to be sorted…by that index.…The advantage of this is that when you have a particularly…large data set, sorting the index reduces the time…to access any subset of that data.…You can sort objects by a label along the axis.…Let's head over to the Jupyter Notebook…to look at a couple of examples.…Let's reuse the ATH data frame…that we created in the previous video.…
So ath.head gives us the first couple of rows.…Now let's set the index to the athlete name,…so ath.set index to athlete.…And we'll do that in place.…So if we're now doing ath.head,…and now we can see that the index is by the athlete's name.…So let's now sort that index.…So ath.sort index,…and we specify that that's looking at in place equals true.…
So we want to change that in place equals false…to in place equals true.…And let's see what changes we see to the ATH data frame.…And we can see that the athlete is now the index…for the data frame.…And this has now been sorted by athlete name.…
- 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.