(dataframe, format_message_string)
Add a message field to a data frame using a format message string.

    Args:
        dataframe (pandas.DataFrame): the data frame containing the data.
        format_message_String (str): the format string used to generate
            a message column.
Add a message field to a data frame using a format message string.
Add a message field to a data frame using a format message string .
def format_data_frame(dataframe, format_message_string):
    """Add a message field to a data frame using a format message string.

    Args:
        dataframe (pandas.DataFrame): the data frame containing the data.
        format_message_String (str): the format string used to generate
            a message column.
    """
    dataframe['message'] = ''

    formatter = string.Formatter()
    for literal_text, field, _, _ in formatter.parse(format_message_string):
        dataframe['message'] = dataframe['message'] + literal_text

        if field:
            dataframe['message'] = dataframe[
                'message'] + dataframe[field].astype(str)
def format_data_frame ( dataframe , format_message_string ) : dataframe [ 'message' ] = '' formatter = string . Formatter ( ) for literal_text , field , _ , _ in formatter . parse ( format_message_string ) : dataframe [ 'message' ] = dataframe [ 'message' ] + literal_text if field : dataframe [ 'message' ] = dataframe [ 'message' ] + dataframe [ field ] . astype ( str )