I have a pandas data frame like this:
Column1 Column2 Column3 Column4 Column5 0 a 1 2 3 4 1 a 3 4
I propose to use .assign
.assign
df2 = df.assign(ColumnA = df.Column2.astype(str) + ', ' + \ df.Column3.astype(str) + ', ' df.Column4.astype(str) + ', ' \ df.Column4.astype(str) + ', ' df.Column5.astype(str))
it's simple, maybe long but it worked for me