Here is what the original data frame looks like:
PLACEMENT SIZE COST
1 placement1 LARGE 1838128.00
58 placement1 MEDIUM 10962048.00
117 placement1 SMALL 2622851.00
175 placement1 UNKNOWN 443.00
2 placement2 LARGE 598.00
59 placement2 MEDIUM 24358.00
118 placement2 SMALL 571802.00
176 placement2 UNKNOWN 1706.00
3 placement3 LARGE 8.00
60 placement3 MEDIUM 22.00
119 placement3 SMALL 502388.00
177 placement3 UNKNOWN 762.00
How do you create a column that shows the percentage of SIZE by PLACEMENT?
I want it to look like this in the end:
PLACEMENT SIZE COST PERCENTAGE
1 placement1 LARGE 1838128.00 11.9
58 placement1 MEDIUM 10962048.00 71.1
117 placement1 SMALL 2622851.00 17.0
175 placement1 UNKNOWN 443.00 0.0
2 placement2 LARGE 598.00 0.1
59 placement2 MEDIUM 24358.00 4.07
118 placement2 SMALL 571802.00 95.54
176 placement2 UNKNOWN 1706.00 0.29
3 placement3 LARGE 8.00 0.0
60 placement3 MEDIUM 22.00 0.0
119 placement3 SMALL 502388.00 99.84
177 placement3 UNKNOWN 762.00 0.16
Any help would be great, thanks! I cannot figure it out with the prop.table library even though I have a feeling that is what I am supposed to be using.