In this video, see how to use head() and tail().
- [Instructor] The head and the tail return the first…and last N rows of a DataFrame.…This is one of the first steps…after reading a file into a Pandas DataFrame…just to get a feel of the rows and columns involved.…By default you will get the first five rows…and the last five rows…if you don't specify any value of N.…Let's head over to our Jupyter Notebook.…So, we enter our DataFrame which is 00 and head.…And that gives us the first five rows…of our DataFrame.…
Alternatively, if we want the last five rows,…we enter 0.tail and that gives us the last five rows…and so, we can see that the first five,…the data seems to be sorted by the edition,…the first five are the ones…for the first Olympics…and the last five are from the information…that we have on the last Olympics from the 2008.…A helpful tip is that sometimes…if you sorted your DataFrame or series,…you might only want to display the top three results.…You can do that by typing 00.head…and three and that will give you…the top three rows.…
Another example of where you might want 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.