How do I use the MultiIndex in pandas?
One of the most powerful features in pandas is multi-level indexing (or "hierarchical indexing"), which allows you to add extra dimensions to your Series or DataFrame objects. But when should you use a MultiIndex, and how do you create, slice, and merge MultiIndexed objects?
In this video, I'll demonstrate:
- How to create a Series with a MultiIndex, and how to convert it to a DataFrame
- How to select from a Series with a MultiIndex
- How to create a DataFrame with a MultiIndex
- How to select from a DataFrame with a MultiIndex
- How to merge two DataFrames with MultiIndexes
WANT TO JOIN MY NEXT WEBCAST? Become a member ($5/month):
https://www.patreon.com/dataschool
=== RELATED RESOURCES ===
Download the lesson notebook: http://nbviewer.jupyter.org/github/justmarkham/pandas-videos/blob/master/pandas_multiindex.ipynb
Using the pandas index (Part 1): https://www.youtube.com/watch?v=OYZNk7Z9s6I&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=17
Using the pandas index (Part 2): https://www.youtube.com/watch?v=15q-is8P_H4&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=18
Analyzing groups with groupby: https://www.youtube.com/watch?v=qy0fDqoMJx8&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=14
Selection and slicing with loc: https://www.youtube.com/watch?v=xvpNA7bC8cs&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=19
My full pandas video series: https://www.youtube.com/playlist?list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y
DataCamp course on MultiIndex: https://www.datacamp.com/courses/manipulating-dataframes-with-pandas?tap_a=5644-dce66f&tap_s=280411-a25fc8
DataCamp course on merging: https://www.datacamp.com/courses/merging-dataframes-with-pandas?tap_a=5644-dce66f&tap_s=280411-a25fc8
Tidy data: http://r4ds.had.co.nz/tidy-data.html
== LET'S CONNECT! ==
Newsletter: https://www.dataschool.io/subscribe/
Twitter: https://twitter.com/justmarkham
Facebook: https://www.facebook.com/DataScienceSchool/
LinkedIn: https://www.linkedin.com/in/justmarkham/
Видео How do I use the MultiIndex in pandas? канала Data School
In this video, I'll demonstrate:
- How to create a Series with a MultiIndex, and how to convert it to a DataFrame
- How to select from a Series with a MultiIndex
- How to create a DataFrame with a MultiIndex
- How to select from a DataFrame with a MultiIndex
- How to merge two DataFrames with MultiIndexes
WANT TO JOIN MY NEXT WEBCAST? Become a member ($5/month):
https://www.patreon.com/dataschool
=== RELATED RESOURCES ===
Download the lesson notebook: http://nbviewer.jupyter.org/github/justmarkham/pandas-videos/blob/master/pandas_multiindex.ipynb
Using the pandas index (Part 1): https://www.youtube.com/watch?v=OYZNk7Z9s6I&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=17
Using the pandas index (Part 2): https://www.youtube.com/watch?v=15q-is8P_H4&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=18
Analyzing groups with groupby: https://www.youtube.com/watch?v=qy0fDqoMJx8&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=14
Selection and slicing with loc: https://www.youtube.com/watch?v=xvpNA7bC8cs&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y&index=19
My full pandas video series: https://www.youtube.com/playlist?list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y
DataCamp course on MultiIndex: https://www.datacamp.com/courses/manipulating-dataframes-with-pandas?tap_a=5644-dce66f&tap_s=280411-a25fc8
DataCamp course on merging: https://www.datacamp.com/courses/merging-dataframes-with-pandas?tap_a=5644-dce66f&tap_s=280411-a25fc8
Tidy data: http://r4ds.had.co.nz/tidy-data.html
== LET'S CONNECT! ==
Newsletter: https://www.dataschool.io/subscribe/
Twitter: https://twitter.com/justmarkham
Facebook: https://www.facebook.com/DataScienceSchool/
LinkedIn: https://www.linkedin.com/in/justmarkham/
Видео How do I use the MultiIndex in pandas? канала Data School
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
My top 25 pandas tricksHow do I make my pandas DataFrame smaller and faster?Pandas MultiIndex Tutorial and Best PracticesHow do I apply a function to a pandas Series or DataFrame?How do I handle missing values in pandas?1000x faster data manipulation: vectorizing with Pandas and NumpyStack, Unstack, Melt, Pivot - PandasHow do I merge DataFrames in pandas?What do I need to know about the pandas index? (Part 1)How do I encode categorical features using scikit-learn?How do I select multiple rows and columns from a pandas DataFrame?Solving real world data science tasks with Python Pandas!Python Pandas Tutorial (Part 8): Grouping and Aggregating - Analyzing and Exploring Your DataHow to combine DataFrames in Pandas | Merge, Join, Concat, & Append4 new time-saving tricks in pandasPython Pandas Tutorial (Part 3): Indexes - How to Set, Reset, and Use IndexesHow do I filter rows of a pandas DataFrame by column value?Python Pivot Tables Tutorial | Create Pandas Pivot Tables | Python Tutorial | Examples, SubtotalsComplete Python Pandas Data Science Tutorial! (Reading CSV/Excel files, Sorting, Filtering, Groupby)How do I find and remove duplicate rows in pandas?