I have a 20 x 4000 dataframe in Python using pandas. Two of these columns are named Year and quarter. I\'d like to create a variable called p
Year
quarter
p
my take....
listofcols = ['col1','col2','col3'] df['combined_cols'] = '' for column in listofcols: df['combined_cols'] = df['combined_cols'] + ' ' + df[column] '''