Combine multiple column values into a single column

Lets create a DataFrame with two columns First_Name and Last_Name.
df = pd.DataFrame() df['First_Name'] = ['John', 'Doe', 'Bill'] df['Last_Name'] = ['Marwel', 'Williams', 'Harry'] df
First_Name Last_Name 0 John Marwel 1 Doe Williams 2 Bill Harry
If both columns (First_Name and Last_Name ) are strings, you can concatenate them directly to a new column.

Join the columns First_Name and Last_Name to a new column FullName

df['FullName'] = df['First_Name'] + df['Last_Name'] df
First_Name Last_Name FullName 0 John Marwel John Marwel 1 Doe Williams Doe Williams 2 Bill Harry Bill Harry

Join Different columns type in Pandas

If one (or both) of the columns are not same typed, you should convert it (them) first and then concatenate them directly to a new column.
df = pd.DataFrame() df['Name'] = ['John', 'Doe', 'Bill'] df['Age'] = [12, 12, 13] df
Name Age 0 John 12 1 Doe 12 2 Bill 13

Here Name and Age are different data types, then you have to convert the column types as same and then concatenate it.

df['Name_age'] = df['Name'] + "_" + df['Age'].astype(str) df
Name Age Name_age 0 John 12 John_12 1 Doe 12 Doe_12 2 Bill 13 Bill_13

Using agg() to join pandas column

If you need to join multiple string columns , you can use agg().
df = pd.DataFrame() df['First_Name'] = ['John', 'Doe', 'Bill'] df['Last_Name'] = ['Marwel', 'Williams', 'Harry'] df
First_Name Last_Name 0 John Marwel 1 Doe Williams 2 Bill Harry

Using agg()

df['FullName'] = df[['First_Name', 'Last_Name']].agg('-'.join, axis=1) df
First_Name Last_Name FullName 0 John Marwel John-Marwel 1 Doe Williams Doe-Williams 2 Bill Harry Bill-Harry

Using apply()

You can use DataFrame.apply() for concatenate multiple column values into a single column, with slightly less typing and more scalable when you want to join multiple columns .
df['FullName'] = df[['First_Name', 'Last_Name']].apply(lambda x: '_'.join(x), axis=1) df
First_Name Last_Name FullName 0 John Marwel John_Marwel 1 Doe Williams Doe_Williams 2 Bill Harry Bill_Harry