Napoleon-Christos Oikonomou has completed
Merging DataFrames with pandas
Start course For Free4 hours
4,650 XP
Loved by learners at thousands of companies
Course Description
As a data scientist, you'll often find that the data you need is not in a single file. It may be spread across a number of text files, spreadsheets, or databases. You’ll want to be able to import the data you’re interested in as a collection of DataFrames and combine them to answer your central questions. This course is all about the act of combining—or merging—DataFrames, an essential part of any data scientist's toolbox. You'll hone your pandas skills by learning how to organize, reshape, and aggregate multiple datasets to answer your specific questions.
Training 2 or more people?
Get your team access to the full DataCamp platform, including all the features.- 1
Preparing data
FreeIn this chapter, you'll learn about different techniques you can use to import multiple files into DataFrames. Having imported your data into individual DataFrames, you'll then learn how to share information between DataFrames using their indexes. Understanding how indexes work is essential to merging DataFrames, which you’ll learn later in the course.
Reading multiple data files50 xpReading DataFrames from multiple files100 xpReading DataFrames from multiple files in a loop100 xpCombining DataFrames from multiple data files100 xpReindexing DataFrames50 xpSorting DataFrame with the Index & columns100 xpReindexing DataFrame from a list100 xpReindexing using another DataFrame Index100 xpArithmetic with Series & DataFrames50 xpAdding unaligned DataFrames50 xpBroadcasting in arithmetic formulas100 xpComputing percentage growth of GDP100 xpConverting currency of stocks100 xp - 2
Concatenating data
You'll learn how to perform database-style operations to combine DataFrames. In particular, you'll learn about appending and concatenating DataFrames while working with a variety of real-world datasets.
Appending and concatenating Series50 xpAppending Series with nonunique Indices50 xpAppending pandas Series100 xpConcatenating pandas Series along row axis100 xpAppending and concatenating DataFrames50 xpAppending DataFrames with ignore_index100 xpConcatenating pandas DataFrames along column axis100 xpReading multiple files to build a DataFrame100 xpConcatenation, keys, and MultiIndexes50 xpConcatenating vertically to get MultiIndexed rows100 xpSlicing MultiIndexed DataFrames100 xpConcatenating horizontally to get MultiIndexed columns100 xpConcatenating DataFrames from a dict100 xpOuter and inner joins50 xpConcatenating DataFrames with inner join100 xpResampling & concatenating DataFrames with inner join100 xp - 3
Merging data
You'll learn all about merging pandas DataFrames. You'll explore different techniques for merging, and learn about left joins, right joins, inner joins, and outer joins, as well as when to use which. You'll also learn about ordered merging, which is useful when you want to merge DataFrames with columns that have natural orderings, like date-time columns.
Merging DataFrames50 xpMerging company DataFrames50 xpMerging on a specific column100 xpMerging on columns with non-matching labels100 xpMerging on multiple columns100 xpJoining DataFrames50 xpJoining by Index50 xpChoosing a joining strategy50 xpLeft & right merging on multiple columns100 xpMerging DataFrames with outer join100 xpOrdered merges50 xpUsing merge_ordered()100 xpUsing merge_asof()100 xp - 4
Case Study - Summer Olympics
To reinforce your new skills, you'll apply them to an in-depth case study using Olympic medal data. The analysis involves integrating your multi-DataFrame skills from this course and skills you've gained in previous pandas courses. This is a rich dataset that will allow you to fully leverage your pandas data manipulation skills.
Medals in the Summer Olympics50 xpLoading Olympic edition DataFrame100 xpLoading IOC codes DataFrame100 xpBuilding medals DataFrame100 xpQuantifying performance50 xpCounting medals by country/edition in a pivot table100 xpComputing fraction of medals per Olympic edition100 xpComputing percentage change in fraction of medals won100 xpReshaping and plotting50 xpBuilding hosts DataFrame100 xpReshaping for analysis100 xpMerging to compute influence100 xpPlotting influence of host country100 xpFinal thoughts50 xp
Training 2 or more people?
Get your team access to the full DataCamp platform, including all the features.Team Anaconda
See MoreData Science Training
Join over 15 million learners and start Merging DataFrames with pandas today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.