how to concat list of columns into one column in pandas dataframe?

I have list of columns , I need to combine them into one column in dataframe. Could you please help me how to do this?

Example:

example-1 column_list = ['File Type', 'Number of Records']
          df['pk'] = df['File Type'] + df['Number of Records']


example-2 column_list = ['File Type', 'Number of Records', 'Indication']
          df['pk'] = df['File Type'] + df['Number of Records'] + df['Indication']


example-3 column_list = ['File Type']
          df['pk'] = df['File Type']

Answer

Select columns by column_list first, then convert values to strings by DataFrame.astype if at least one non string column and last join in DataFrame.agg:

df['pk'] = df[column_list].astype(str).agg(''.join, axis=1)

Or in DataFrame.apply:

df['pk'] = df[column_list].astype(str).apply(''.join, axis=1)

Sample:

df = pd.DataFrame({'File Type':['aa','bb'], 
                   'Number of Records':[1,5],
                   'Indication':['ind1','ind2']})

column_list1 = ['File Type', 'Number of Records']
column_list2 = ['File Type', 'Number of Records', 'Indication']
column_list3 = ['File Type']
df['pk1'] = df[column_list1].astype(str).agg(''.join, axis=1)
df['pk2'] = df[column_list2].astype(str).agg(''.join, axis=1)
df['pk3'] = df[column_list3].astype(str).agg(''.join, axis=1)
print (df)
  File Type  Number of Records Indication  pk1      pk2 pk3
0        aa                  1       ind1  aa1  aa1ind1  aa
1        bb                  5       ind2  bb5  bb5ind2  bb

Another idea is use sum:

df['pk1'] = df[column_list1].astype(str).sum(axis=1)
df['pk2'] = df[column_list2].astype(str).sum(axis=1)
df['pk3'] = df[column_list3].astype(str).sum(axis=1)
print (df)
  File Type  Number of Records Indication  pk1      pk2 pk3
0        aa                  1       ind1  aa1  aa1ind1  aa
1        bb                  5       ind2  bb5  bb5ind2  bb

Problem of sum solution is converting output to floats if join numeric column(s):

df = pd.DataFrame({'File Type':[4,5], 'Number of Records':[1,5], 'Indication':[8,9]})

column_list1 = ['File Type', 'Number of Records']
column_list2 = ['File Type', 'Number of Records', 'Indication']
column_list3 = ['File Type']
df['pk1'] = df[column_list1].astype(str).sum(axis=1)
df['pk2'] = df[column_list2].astype(str).sum(axis=1)
df['pk3'] = df[column_list3].astype(str).sum(axis=1)
print (df)
   File Type  Number of Records  Indication   pk1    pk2  pk3
0          4                  1           8  41.0  418.0  4.0
1          5                  5           9  55.0  559.0  5.0

print (df.dtypes)
File Type              int64
Number of Records      int64
Indication             int64
pk1                  float64
pk2                  float64
pk3                  float64
dtype: object