Updates to table suppression
jim-smith opened this issue · comments
- marginal totals should be totals of non-suppressed cells
- assert row_total=column_total and set this to table total
- suggest for now do not provide columns/rows with subtotals for different groups within a hierarch if index or columns is a vector of factors
- Suppressed cells could have the text f'<{N}" inserted at the last minute?
write unit test to check that subtotals are not taking into account suppressed values.
then
- if they are we might have to set the suppressed values to zero, calculate subtotals on the altered table, then replace 0s back to NaN in the results data frame.
or - manually add/edit marginal rows/columns in the data frame just before we return it, but that could be complex??
or
3 . after we have calculate the masks, each cell to be suppressed represents a boolean condition on the data,
so maybe it is easier to negate them and then use pandas queries to remove those data items - but it might mess yp what we pass to the viewer
probably try 2 first