merge_machine/missing_values.py
def mv_from_common_values_2(col_mvs, score=1):
    """
    Return mv candidates for missing values that are already candidates in 
    at least two columns.    
    """
    # Make dict with key: mv_candidate value: list of columns where applicable
    val_mvs = dict()
    for col, tuples in col_mvs.items():
        for (val, score, origin) in tuples:
            if val not in val_mvs:
                val_mvs[val] = [col]
            else:
                val_mvs[val].append(col)
                
    return [(val, score, 'common_values') for val, cols in val_mvs.items() if (len(cols)>=2)]

    Return mv candidates for missing values that are already candidates in 
    at least two columns.    
    
Return mv candidates for missing values that are already candidates in
at least two columns.
Return mv candidates for missing values that are already candidates in at least two columns .
def mv_from_common_values_2(col_mvs, score=1):
    val_mvs = dict()
    for col, tuples in col_mvs.items():
        for (val, score, origin) in tuples:
            if val not in val_mvs:
                val_mvs[val] = [col]
            else:
                val_mvs[val].append(col)
    return [(val, score, 'common_values') for val, cols in val_mvs.items() if (len(cols)>=2)]
def mv_from_common_values_2 ( col_mvs , score = 1 ) : val_mvs = dict ( ) for col , tuples in col_mvs . items ( ) : for ( val , score , origin ) in tuples : if val not in val_mvs : val_mvs [ val ] = [ col ] else : val_mvs [ val ] . append ( col ) return [ ( val , score , 'common_values' ) for val , cols in val_mvs . items ( ) if ( len ( cols ) >= 2 ) ]
Return mv candidates for missing values that are already candidates in
at least two columns.
Return mv candidates for missing values that are already candidates in at least two columns .
"""
    Return mv candidates for missing values that are already candidates in 
    at least two columns.    
    """ # Make dict with key: mv_candidate value: list of columns where applicable
col_mvs
score