def binarization(imputed, raw):
    """
    Transform imputed float values to binary
        imputed values at (i, j) -> 1: 
            greater than average value of ith peak in raw data
            greater than average value of jth cell in raw data
        otherwise 0
    """
    peak_mean = raw.mean(1)
    cell_mean = raw.mean(0)
    v1 = imputed.gt(peak_mean, axis=0)
    v2 = imputed.gt(cell_mean, axis=1)
    binary = (v1 & v2).astype(int)
    return binary
