<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def df_string(df, percentage_columns=(), format_map=None, **kwargs):
 """Return a nicely formatted string for the given dataframe. Arguments --------- df : pandas.DataFrame A dataframe object. percentage_columns : iterable A list of cloumn names to be displayed with a percentage sign. Returns ------- str A nicely formatted string for the given dataframe. Example ------- num char 1 8 a 2 5 b """

    formatters_map = {}
    for col, dtype in df.dtypes.iteritems():
        if col in percentage_columns:
            formatters_map[col] = '{:,.2f} %'.format
        elif dtype == 'float64':
            formatters_map[col] = '{:,.2f}'.format
    if format_map:
        for key in format_map:
            formatters_map[key] = format_map[key]
    return df.to_string(formatters=formatters_map, **kwargs)