What happens when there is a mismatch when performing a merge?

Question

In the context of this exercise, what happens when there is a mismatch when performing a merge?

Answer

When there is a mismatch for a merge of two dataframes, the rows that have no match will simply not be included in the result dataframe.

By default the pd.merge() method performs an inner merge, which means that it will only return a row if there is a matching value in both dataframes.

3 Likes

What happen if you merge two columns that both have Null values? Will this row is printed in merged table?

4 Likes

My first guess was it doesn´t as logic tells me a Null value is “empty”, but after a little research it seems it does include those rows:

The link contains a solution to this tho.

Hope it helps, cheers! :beer:

1 Like