PANDAS Bobot Grup Rata -rata
sales.groupby("Manager").apply(lambda x: np.average(x['New_Product_Price'], weights=x['Quantity']))
Disgusted Dormouse
sales.groupby("Manager").apply(lambda x: np.average(x['New_Product_Price'], weights=x['Quantity']))
(sales["Current_Price"] * sales["Quantity"]).sum() / sales["Quantity"].sum()
(sales["New_Product_Price"] * sales["Quantity"]).sum() / sales["Quantity"].sum()