Fixing Python Pandas crosstab Wrong Margins When Values Param Is Set
Setting the values param in pd.crosstab() gives you aggregated cells, but the All margin row and column often show unexpected totals. Here's exactly why it happens and how to fix it for good.