Store sum of column sums , max of column sum number of non zero column sums
for i in range ( c ) : NEW_LINE INDENT column_sum = column_sum + column [ i ] NEW_LINE column_max = max ( column_max , column [ i ] ) NEW_LINE if ( column [ i ] ) : NEW_LINE INDENT column_non_zero = column_non_zero + 1 NEW_LINE DEDENT DEDENT