for loop to extract header for a dataframe in pandas
<p>I am a newbie in python. I have a data frame that looks like this:</p>

<pre><code>    A   B   C   D   E
0   1   0   1   0   1
1   0   1   0   0   1
2   0   1   1   1   0
3   1   0   0   1   0
4   1   0   0   1   1
</code></pre>

<p>How can I write a for loop to gather the column names for each row. I expect my result set looks like that:</p>

<pre><code>    A   B   C   D   E   Result
0   1   0   1   0   1   ACE
1   0   1   0   0   1   BE
2   0   1   1   1   0   BCD
3   1   0   0   1   0   AD
4   1   0   0   1   1   ADE
</code></pre>

<p>Anyone can help me with that? Thank you!</p>