Join Michele Vallisneri for an in-depth discussion in this video Using multilevel indices, part of Introduction to Data Analysis with Python.
- View Offline
- Exercise Files
- [Voiceover] Pandas is rather sophisitacted…in its treatment of indexes.…For instance, it lets you use indices with multiple levels,…that is, it let's you use compound labels.…I will show you how to create…such a MultiIndex object,…how to use it to index DataFrames,…and how to apply the stack and unstack Pandas function,…which trade between levels of an index…and column names.…Let's go the IPython notebook.…Select the 06_04_multilevel_begin exercise file.…
I will start my importing Pandas…and by importing Seaborn.…Although Seaborn is an extension…to the plotting package matplotlib,…it also includes some interesting datasets.…We're going to use one of them as an example.…The dataset flights…contains data about passengers…who took flights between 1949 and 1960.…With the head method of a Pandas DataFrame,…I'm only showing you the very beginning of the frame.…
In this case, it's convenient to use a Pandas MultiIndex…by telling Pandas to index the dataframe flights…with both, year and month.…Let's see the result.…The IPython notebook shows us…
- Writing and running Python in iPython
- Using Python lists and dictionaries
- Creating NumPy arrays
- Indexing and slicing in NumPy
- Downloading and parsing data files into NumPy and Pandas
- Using multilevel series in Pandas
- Aggregating data in Pandas
Skill Level Intermediate
1. Installation and Setup
2. Refresher: Data Containers in Python
3. Word Anagrams in Python
4. Introduction to NumPy
5. Weather Data with NumPy
6. Introduction to Pandas
7. Baby Names with Pandas
Next steps1m 36s
- 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.