title: How to combine two columns containing np.arrays to one column
body: <p>I am reading in a CSV file that contains arrays in the columns. I would like to concatenate the lists in the columns together into a new column containing just one list as I have to do some transformations with it.</p>
  <pre><code>d = {'col1': [[1,2], [1,2],[1,2]], 'col2': [[1,2], [], [1,2,4,5,6,7]]}
  df = pd.DataFrame(data=d)
  </code></pre>
  <pre><code>    col1    col2
  0   [1, 2]  [1, 2]
  1   [1, 2]  []
  2   [1, 2]  [1, 2, 4, 5, 6, 7]
  </code></pre>
  <p>In a first step I convert them to numerical arrays.</p>
  <pre><code>df[&quot;col1&quot;] = df['col1'].apply(lambda x : np.fromstring(str(x).replace('[','').replace(']',''), sep=',').astype(int))
  df[&quot;col2&quot;] = df['col2'].apply(lambda x : np.fromstring(str(x).replace('[','').replace(']',''), sep=',').astype(int))
  </code></pre>
  <p>In a second step I want to combine them in one column.</p>
  <pre><code>    col1    col2                col3
  0   [1, 2]  [1, 2]              [1, 2, 1, 2]
  1   [1, 2]  []                  [1, 2]  
  2   [2, 3]  [1, 2, 4, 5, 6, 7]  [2, 3, 1, 2, 4, 5, 6, 7]
  </code></pre>
  <p>but I always end up with</p>
  <pre><code>    col1    col2                col3
  0   [1, 2]  [1, 2]              [[1, 2], [1, 2]]
  1   [1, 2]  []                  [[1, 2], []]  
  2   [2, 3]  [1, 2, 4, 5, 6, 7]  [[2, 3], [1, 2, 4, 5, 6, 7]]
  </code></pre>