# Move from Excel to Python with Pandas Transcripts Chapter: Case study walk through: Sales commissions Lecture: Product commission variable amounts

0:00 up until now, we've just used one commission re. But since we know our business,
0:05 we know that we don't need to do as much work to sell products through the
0:09 partner and reseller spaces. So maybe we should adjust those commissions down. So let's set a new partner rate these air to starting values,
0:18 and we'll do some analysis to see how this impacts air total commissions.
0:26 Now we've added the commission rates so that we can modify it for each transaction.
0:31 And here's the commission rate. Now we want to update it where the customers are
0:35 partners or resellers. It's a type of there where their partners or resellers and apply
0:46 that lower commission rate and see how it changes the total commissions we need to build
0:51 a Boolean. Siri's identify which transactions are partners in which our resellers, in which a reto. So let's start with that.
1:04 So to refresh your memory about what we've done here. If you look at partners, we now have a true false list of all of
1:11 those values that our partners are all those transactions, their partners. So now that we have that true false list,
1:17 let's go ahead and update our data frame so that those transactions can have the lower commission rate. Now we have the new rates,
1:29 and because all of these top transactions are retail, it's not showing up. But it is in there. If we want to see what the rates are,
1:37 let's just do a quick check. So now we can see that we do have variable rates in here.
1:43 The final step is we need to actually calculate the commission's. So now we have a commission rate and we multiply that by the invoice total to
1:52 get the new commission. So we have a dynamic model now that will give us a different calculation for the commission.
2:00 So let's check that. See now or commissions are 565,000 versus one million, which makes sense because we lower those rates.
2:10 Now let's see what the impact was on our total commissions paid. We already did that calculation. Copy this down here.
2:22 I'm also gonna add margins equal true to show totals. So now we can see that the commission's have come down for Tiner and sudden,
2:34 but they've also come down quite a bit for Malcolm immunised. So we still have this discrepancy. So we've created some room in our commission values,

Talk Python's Mastodon Michael Kennedy's Mastodon