survey has columns gender and purchased.
Return the same contingency table as the counts version, but with each row scaled to percentages summing to 100, rounded to 2 decimal places.
The normalisation is over rows, not the whole table, so each gender's row sums to 100 regardless of how many people are in it.
Input
gender purchased
0 f yes
1 f no
2 m yes
3 m yes
4 m no
5 f yes
Output
purchased no yes
gender
f 33.33 66.67
m 33.33 66.67