Join Jonathan Fernandes for an in-depth discussion in this video Using reset_index(), part of pandas Essential Training.
- [Narrator] Now, not surprisingly,…the opposite of setting an index is to reset the index.…And what we're doing here is we're returning a DataFrame…to its default, integer-based index.…Let's head over to our Jupyter notebook for an example.…Now we know that ath is a data frame…that is indexed by athlete,…because we did this in the previous video.…So let's reset the ath data frame,…so that it is indexed by the integers.…
So ath.reset_index,…and SHIFT and TAB to look at the options, and we see…that we run into the same problem…that we did with set_index where we need to specify…that the inplace is true, if we want…to do it to the ath data frame,…or we can specify that inplace equals false,…and then we need to set this data frame…to another data frame.…So let's say, inplace equals true.…And we do an ath.head and here we expect the index…to be back to the integer-based indices for our data frame.…
In the real world, you can often use the reset index,…especially when you're trying to determine…which is the best series to use…
- 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.