How to merge/combine columns in pandas? : <p>I have a (example-) dataframe with 4 columns:</p>

<pre><code>data = {'A': ['a', 'b', 'c', 'd', 'e', 'f'],
    'B': [42, 52, np.nan, np.nan, np.nan, np.nan],  
    'C': [np.nan, np.nan, 31, 2, np.nan, np.nan],
    'D': [np.nan, np.nan, np.nan, np.nan, 62, 70]}
df = pd.DataFrame(data, columns = ['A', 'B', 'C', 'D'])

    A   B       C       D
0   a   42.0    NaN     NaN
1   b   52.0    NaN     NaN
2   c   NaN     31.0    NaN
3   d   NaN     2.0     NaN
4   e   NaN     NaN     62.0
5   f   NaN     NaN     70.0
</code></pre>

<p>I would now like to merge/combine columns B, C, and D to a new column E like in this example:</p>

<pre><code>data2 = {'A': ['a', 'b', 'c', 'd', 'e', 'f'],
    'E': [42, 52, 31, 2, 62, 70]}
df2 = pd.DataFrame(data2, columns = ['A', 'E'])

    A   E
0   a   42
1   b   52
2   c   31
3   d   2
4   e   62
5   f   70
</code></pre>

<p>I found a quite similar question <a href="https://stackoverflow.com/questions/39276249/merge-two-dataframe-columns-into-1-in-pandas">here</a> but this adds the merged colums B, C, and D at the end of column A:</p>

<pre><code>0      a
1      b
2      c
3      d
4      e
5      f
6     42
7     52
8     31
9      2
10    62
11    70
dtype: object
</code></pre>

<p>Thanks for help.</p>
