title: Pandas: combine multiple rows into one row based on index
body: <p>I have the following DataFrame:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame({'Q10: HEDGE FUND':['NO', 'YES', 'NO'],
                     'Q10: PRIVATE EQUITY FUND': ['NO', 'YES', 'YES'],
                     'Q10: REAL ESTATE FUND': ['YES', 'NO', 'NO']}).T
  
                              0    1    2
  Q10: HEDGE FUND            NO  YES   NO
  Q10: PRIVATE EQUITY FUND   NO  YES  YES
  Q10: REAL ESTATE FUND     YES   NO   NO
  </code></pre>
  
  <p><strong>What I want:</strong></p>
  
  <pre><code>                    0    1                    2
  Q10  REAL ESTATE FUND  N/A  PRIVATE EQUITY FUND
  </code></pre>
  
  <p>That is, I want to take the three Q10 rows and combine them into 1, listing the type of fund. </p>
  
  <p>Each column corresponds to a type of fund. Column 0 is a Real Estate Fund (notice that there's a YES in the Q10: REAL ESTATE FUND row). Column 2 is a Private Equity Fund (notice there's a YES in the Q10: PRIVATE EQUITY row). Column 1, however, lists has two YESes, which is an error in the dataframe. I need to change this to N/A.</p>
  
  <p>What I've tried: for each column I can locate the position of the 'YES' in each column, but I dont know how to deal with column 1 (which has two yeses, so should be changed to N/A) and I feel there's a more seamless way of doing this:</p>
  
  <pre><code>df[0].tolist().index('YES')
  2
  </code></pre>