I have a dataframe which includes names, age and score. What I'm trying to do is pass the name, age and score into a message (a string) using the format() method.
Code:
import pandas as pd
df = pd.read_csv('data.csv')
df
A B C
0 Matt 23 0.98
1 Mark 34 9.33
2 Luke 52 2.54
3 John 67 4.73
The message I want to pass this data into:
message = "{} is {} years old and has a score of {}"
My limited understanding of using the .format() method with the message (string)
message.format()
From what I can tell, I need to have the dataframe as 1 of the arguments for the format() method, butother than that, I'm unsure as to how to code this up.
Help/assistance is greatly appreciated.