def simplify_cols(df):
    """
    for pandas dataframe columns:
    replace spaces with underscores and changes everything to lowercase
    This allows for dot notation. As a side effect, mutiple spaces get 
    reduced to one, and leading/triling spaces are removed entirely
    """
    old_cols = list(str(df.columns))
    new_cols = ['_'.join(col.lower().split()) for col in old_cols]
    rename = dict(zip(old_cols,new_cols))
    return df.rename(columns=rename)