From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Inner joins

Inner joins

- [Instructor] All right, so let's take a look at an INNER JOIN. And when we're joining tables for the first time in particular, it can be very helpful to keep an eye on our row numbers. So, here we have our item sales DataFrame that has over a million rows, 1,054,944 to be exact. We then have our Right Table, which is store_transactions, and this table has 83,488. And so when we're performing an INNER JOIN, there's a chance we're going to lose rows if a match isn't found between our Left and Right Tables. So, when we perform an INNER JOIN between these two tables on store number and date, we end up with 1,026,168. So, we lost some rows of data from our Left Table because we didn't find a match in our Right Table, and the reason why is because we found some rows that didn't match. One example is that January 1st, 2016 was not in our transactions table, and because we were performing an INNER JOIN, it is not included in the join table, which leads to a reduced row count. So, the loss…

Contents