<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 PB Python Excel Filter and Edit Example
Full article is posted here - http
Step1:  Add a default commision rate of 2% for all sales
Step2:  Since shirts are high margin, adjust all products in the shirt categort with a commission rate of 2.5%
Step3:  Since there is a special program for selling 10 or more belts in a transaction, you get 4% commission!
Step4:  Finally, some transactions can get a bonus and a commission increase.
Step5:  Calculate the compensation at the line item leve
Step6:  Calculate the commissions by sales rep
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.read_excel("https://github.com/chris1610/pbpython/blob/master/data/sample-sales-reps.xlsx?raw=true")
df.head()
Explanation: PB Python Excel Filter and Edit Example
Full article is posted here - http://pbpython.com/excel-filter-edit.html
End of explanation
df["commission"] = .02
df.head()
Explanation: Add a default commision rate of 2% for all sales
End of explanation
df.loc[df["category"] == "Shirt", ["commission"]] = .025
df.head()
Explanation: Since shirts are high margin, adjust all products in the shirt categort with a commission rate of 2.5%
End of explanation
df.loc[(df["category"] == "Belt") & (df["quantity"] >= 10), ["commission"]] = .04
df.head()
Explanation: Since there is a special program for selling 10 or more belts in a transaction, you get 4% commission!
End of explanation
df["bonus"] = 0
df.loc[(df["category"] == "Shoes") & (df["ext price"] >= 1000 ), ["bonus", "commission"]] = 250, 0.045
df.ix[3:7]
Explanation: Finally, some transactions can get a bonus and a commission increase.
End of explanation
df["comp"] = df["commission"] * df["ext price"] + df["bonus"]
df.head()
Explanation: Calculate the compensation at the line item leve
End of explanation
df.groupby(["sales rep"])["comp"].sum().round(2)
Explanation: Calculate the commissions by sales rep
End of explanation
<END_TASK>