def table_from_bool(ind1, ind2):
    """
    Given two boolean arrays, return the 2x2 contingency table

    ind1, ind2 : array-like
        Arrays of the same length
    """
    return [
            sum(ind1 & ind2),
            sum(ind1 & ~ind2),
            sum(~ind1 & ind2),
            sum(~ind1 & ~ind2),
        ]