From the course: Faster pandas

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding the join function

Understanding the join function

From the course: Faster pandas

Start my 1-month free trial

Understanding the join function

- It is common to have one data frame with data and then enhance it with data from another data frame. Let's have a look. So ipython and we're going to import pandas as pd, and our data frame is pd.read_csv of the taxi data frames that we have. And let's have a look at random five rows from the data frame. So there after sampled five, and we look at the rows and we see that the vendor id, is a number we would like to add the vendor name. So we can say that the ndf is pd.data frame, where, one is creative and two is very fun and a four is big Apple. And then we say that the columns, are the id and the vendor, and we look at the data frame and now we can do pandas.merge of the data frame, the name data frame and then we need to tell pandas how to do it. So we say left on equal vendor id, and the right on equal the id, and how we going to do a lift merge. And we see now that we've got the data frame and if you look on the right side, you will see that we get the vendor as well. So how…

Contents