title: How to row-wise concatenate several columns containing strings?
body: <p>I have a specific series of datasets which come in the following general form:</p>
  <pre><code>import pandas as pd
  import random
  df = pd.DataFrame({'n': random.sample(xrange(1000), 3), 't0':['a', 'b', 'c'], 't1':['d','e','f'], 't2':['g','h','i'], 't3':['i','j', 'k']})
  </code></pre>
  <p>The number of <em>tn</em> columns (<em>t0, t1, t2 ... tn</em>) <strong>varies depending on the dataset</strong>, but is always &lt;30.
  My aim is to merge the content of the <em>tn</em> columns for each row so that I achieve this result (note that for readability I need to keep the whitespace between elements):</p>
  <pre><code>df['result'] = df.t0 +' '+df.t1+' '+df.t2+' '+ df.t3
  </code></pre>
  <p><a href="https://i.stack.imgur.com/eEl4x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eEl4x.png" alt="enter image description here" /></a></p>
  <p>So far so good. This code may be simple but it becomes clumsy and inflexible as soon as I receive another dataset, where the number of <em>tn</em> columns goes up. This is where my question comes in:</p>
  <p><strong>Is there any other syntax to merge the content across multiple columns?</strong> Something agnostic to the number columns, akin to:</p>
  <pre><code>df['result'] = ' '.join(df.ix[:,1:])
  </code></pre>
  <p>Basically, I want to achieve the same as the OP in the link below, but with whitespace between the strings:
  <a href="https://stackoverflow.com/questions/6308933/r-concatenate-row-wise-across-specific-columns-of-dataframe">Concatenate row-wise across specific columns of dataframe</a></p>