This question may be very basic, but I would like to concatenate three columns in a pandas DataFrame.
I would like to concatenate col1, col2 and col3 into col4. I know in R this could be done with the paste function quite easily.
df = pd.DataFrame({'col1': [2012, 2013, 2014], 'col2': 'q', 'col3': range(3)})
Edit: Code for clarity - I would like to generate col4 automatically:
x=pd.DataFrame()
x['col1'] = [2012,2013,2013]
x['col2'] = ['q', 'q', 'q']
x['col3'] = [1,2,3]
x['col4'] = ['2012q1', '2013q2', '2014q4']