I have a data frame of two columns col1 and col2 I want to fill column 3 from value col1 and col2.
df['col3'] = "122 (xxxxx): Don't show temp df['col1'] and df['col2']"
Does anyone knows how to do please?
I have a data frame of two columns col1 and col2 I want to fill column 3 from value col1 and col2.
df['col3'] = "122 (xxxxx): Don't show temp df['col1'] and df['col2']"
Does anyone knows how to do please?
You could try to use apply function:
df['col3'] = df.apply(lambda x: f"122 (xxxxx): Don't show temp {x['col1']} and {x['col2']}", axis=1)
You can directly do
df['col3'] = "Text1" + df['col1'] + "Text2" + df['col2']
Might need to use .astype(str) if datatype is not string!