def _expand_table(table):
 return np.repeat([[1, 1], [1, 0], [0, 1], [0, 0]], table.ravel(), axis=0)

def _expand_table ( table ) : return np . repeat ( [ [ 1 , 1 ] , [ 1 , 0 ] , [ 0 , 1 ] , [ 0 , 0 ] ] , table . ravel ( ) , axis = 0 )
expand a 2 by 2 contingency table to observations .