Move from Excel to Python with Pandas Transcripts
Chapter: Case study walk through: Sales commissions
Lecture: Combining customer sales reps

Login or purchase this course to watch this video and the rest of the course contents.
0:00 in the previous exercise, we looked at customer information and figured out the effective sales
0:06 commission rate per customer. But what we need to figure out now is how do we pull in the sails rap associated with each customer?
0:14 So I'm going to create a new notebook, and I'm keeping my original notebook open because I may want to copy and pay some
0:21 of the data between so I can leverage the work I did in the past. So in this example, I started my new notebook and filled in the information at
0:28 the top. Now I'm going to give my imports and the other piece on one of leverages the data that I already have to read in the file so and copy
0:38 and paste that over. It's still going to read in our customer master. I'm still gonna leave that report file in place so that I can use it in
0:45 the future, and then we'll remember when we read in this file. We already figured out how to read in the file using the ZIP code correctly.
0:53 I'm gonna call this a different data frame, though they call it the of Customers. And the other thing I'm gonna do.
0:59 It's actually specify the sheet name, and the reason it worked before is because customers is the first sheep name. Now we've read in her file,
1:10 and the other sheet is the sales reps. So let's go ahead and read that in a swell. This is just the sale sheet.
1:30 Now we read in the sales rep. So we have the sales rep information and our customers, and we want to join these two data frames.
1:37 Together. You'll notice a challenge. The sales reps are identified by region, but our customers on Lee have a state,
1:44 so we don't have a good way to tie those two together. So let's walk through how we would do that.

Talk Python's Mastodon Michael Kennedy's Mastodon