I have a pandas dataframe (df) with a df['Message'], df['value1'], df['value2'] ...etc The Messages in the ['Message'] column are formatted strings such as: 'CPU-Value: %d, Event-Type: %s, ..,..'
My goal is to replace the %d or %s in ['Message'] with values from the other columns ['value1'] and ['value2']...
The following approach would not work: (it works only for {} formatted strings)
for index, row in df['Message'].items():
df['Message'] = df['Message'][index].format(str(df['value1'][index]), ......)
Is there any advice on how to replace the variables/format the string with values from other columns.