def binarize(qualitative):
    """
    binarizes an expression dataset.
    """
    thresholds = qualitative.min(1) + (qualitative.max(1) - qualitative.min(1))/2.0
    binarized = qualitative > thresholds.reshape((len(thresholds), 1)).repeat(8,1)
    return binarized.astype(int)