def clean_colnames ( df ) : col_list = [ ] for index in range ( _dutils . cols ( df ) ) : col_list . append ( df . columns [ index ] . strip ( ) . lower ( ) . replace ( ' ' , '_' ) ) df . columns = col_list
python set all columns to lower
Cleans the column names on a DataFrame Parameters : df - DataFrame The DataFrame to clean
def clean_colnames(df):
    """ Cleans the column names on a DataFrame
    Parameters:
    df - DataFrame
        The DataFrame to clean
    """
    col_list = []
    for index in range(_dutils.cols(df)):
        col_list.append(df.columns[index].strip().lower().replace(' ','_'))
    df.columns = col_list