feature-engineering-and-data-transformations/using-toy-exmaples/feature_cleaning/missing_data.py
def impute_NA_with_arbitrary(data,impute_value,NA_col=[]):
    """
    replacing NA with arbitrary values. 
    """
    
    data_copy = data.copy(deep=True)
    for i in NA_col:
        if data_copy[i].isnull().sum()>0:
            data_copy[i+'_'+str(impute_value)] = data_copy[i].fillna(impute_value)
        else:
            warn("Column %s has no missing cases" % i)
    return data_copy

    replacing NA with arbitrary values. 
    
replacing NA with arbitrary values.
replacing NA with arbitrary values .
def impute_NA_with_arbitrary(data,impute_value,NA_col=[]):
    data_copy = data.copy(deep=True)
    for i in NA_col:
        if data_copy[i].isnull().sum()>0:
            data_copy[i+'_'+str(impute_value)] = data_copy[i].fillna(impute_value)
        else:
            warn("Column %s has no missing cases" % i)
    return data_copy
def impute_NA_with_arbitrary ( data , impute_value , NA_col = [ ] ) : data_copy = data . copy ( deep = True ) for i in NA_col : if data_copy [ i ] . isnull ( ) . sum ( ) > 0 : data_copy [ i + '_' + str ( impute_value ) ] = data_copy [ i ] . fillna ( impute_value ) else : warn ( "Column %s has no missing cases" % i ) return data_copy
replacing NA with arbitrary values.
replacing NA with arbitrary values .
"""
    replacing NA with arbitrary values. 
    """
data
impute_value
NA_col