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 products table is out of date and is missing the newest product: Product 5. What happens when someone orders it?



We’ve just released a new product with product_id equal to 5. People are ordering this product, but we haven’t updated the products table.

In script.py, you’ll find two DataFrames: products and orders. Inspect these DataFrames using print.

Notice that the third order in orders is for the mysterious new product, but that there is no product_id 5 in products.


Merge orders and products and save it to the variable merged_df.

Inspect merged_df using:


What happened to order_id 3?

Sign up to start coding

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?