def clean_feature_names(df):
    """Function returns dataframe with spaces and newlines replaced by underscores in feature names"""
    clean_feat = []
    for f in df.columns:
        clean_feat.append(((f.casefold()).replace("\n","_")).replace(" ","_"))
    df=df.rename(columns=dict(zip(df.columns,clean_feat)))
    
    return df