preprocessing.py
def encode_features(df):
    '''
    This function encodes non-numeric features for use in modeling.
    Takes in df and returns df.
    '''
    # encode 'explicit'
    df['is_explicit'] = df.explicit.map({True: 1, False: 0})
    df = df.drop(columns=['explicit'])
    return df

    This function encodes non-numeric features for use in modeling.
    Takes in df and returns df.
    
This function encodes non-numeric features for use in modeling.
Takes in df and returns df.
This function encodes non - numeric features for use in modeling . Takes in df and returns df .
def encode_features(df):
    df['is_explicit'] = df.explicit.map({True: 1, False: 0})
    df = df.drop(columns=['explicit'])
    return df
def encode_features ( df ) : df [ 'is_explicit' ] = df . explicit . map ( { True : 1 , False : 0 } ) df = df . drop ( columns = [ 'explicit' ] ) return df
This function encodes non-numeric features for use in modeling.
This function encodes non - numeric features for use in modeling .
'''
    This function encodes non-numeric features for use in modeling.
    Takes in df and returns df.
    ''' # encode 'explicit'
df