Multiple Tables in Pandas

Learn how to combine information from multiple DataFrames.

Start[missing "en.views.course_landing_page.data-processing-pandas.course_illustration" translation]
Working with Multiple DataFrames
Lesson 1 of 1
  1. 1

    In order to efficiently store data, we often spread related information across multiple tables. For instance, imagine that we own an e-commerce business and we want to track the products that have...

  2. 2

    Suppose we have the following three tables that describe our eCommerce business: - [...] — a table with information on each transaction: order_id customer_id product_id quantity ...

  3. 3

    It is easy to do this kind of matching for one row, but hard to do it for multiple rows. Luckily, Pandas can efficiently do this for the entire table. We use the [...] method. The ** [...]...

  4. 4

    In addition to using [...] , each DataFrame has its own [...] method. For instance, if you wanted to merge [...] with [...] , you could use: [...] This produces the same DataFrame as if we...

  5. 5

    In the previous example, the [...] function "knew" how to combine tables based on the columns that were the same between two tables. For instance, [...] and [...] both had a column called [...

  6. 6

    In the previous exercise, we learned how to use [...] to merge two DataFrames whose columns don't match. If we don't want to do that, we have another option. We could use the keywords [...] a...

  7. 7

    In our previous examples, there were always matching values when we were performing our merges. What happens when that isn't true? Let's imagine that our [...] table is out of date and is missi...

  8. 8

    In the previous exercise, we saw that when we merge two DataFrames whose rows don't match perfectly, we lose the unmatched rows. This type of merge (where we only include matching rows) is called ...

  9. 9

    Let's return to the merge of Company A and Company B. --- ### Left Merge Suppose we want to identify which customers are missing phone information. We would want a list of all customers who have...

  10. 10

    Sometimes, a dataset is broken into multiple tables. For instance, data is often split into multiple CSV files so that each download is smaller. When we need to reconstruct a single DataFrame fro...

  11. 11

    This lesson introduced some methods for combining multiple DataFrames: Creating a DataFrame made by matching the common columns of two DataFrames is called a [...] We can specify which column...

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo

Multiple Tables in Pandas

Start[missing "en.views.course_landing_page.data-processing-pandas.course_illustration" translation]