def df_to_dictionaries(df, change_names={}, include_index=True):
    """Returns a list of dictionaries, one dictionary for each row in the 
    DataFrame 'df'.  The keys of the dictionary match the DataFrame column names,
    except for any substitututions provided in the 'change_names' dictionary;
    {'old_name': 'new_name', etc}.  If 'include_index' is True, the index 
    values are included in the dictionary keyed on the index name (unless changed
    in the 'change_names' dictionary)
    """
    # make a list of the final names to use
    names = list(df.columns.values)
    if include_index:
        names = [df.index.name] + names
        
    # apply name substitutions
    for i in range(len(names)):
        names[i] = change_names.get(names[i], names[i])
    
    result = []
    for ix, row in df.iterrows():
        vals = list(row.values)
        if include_index:
            vals = [ix] + vals
        result.append(
            dict(zip(names, vals))
        )
    
    return result