title: Creating a new column based off contents of others columns
body: <p>I have a dataframe, shown here.</p>
  
  <p><a href="https://i.stack.imgur.com/YfZbF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YfZbF.png" alt="enter image description here"></a></p>
  
  <p>I want to create a new column called <code>Result</code></p>
  
  <p>Result should be created based off the following rules. </p>
  
  <ol>
  <li>Return the value that is shown the most based off columns <code>D,F,M,P</code></li>
  <li>If there is a tie between <code>IG</code> and <code>HY</code>, return <code>HY</code>.</li>
  <li>Do not count <code>NaN</code> as a value.</li>
  </ol>
  
  <p>My resulting dataframe would like this: </p>
  
  <p><a href="https://i.stack.imgur.com/4O3TM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4O3TM.png" alt="enter image description here"></a></p>
  
  <pre><code> df_start = pd.DataFrame({'P':['IG','HY','IG',np.nan,'HY'], 'M':['HY','HY','IG', np.nan,'IG'], 'F':['HY',np.nan,'HY', np.nan,'IG'],'D':['IG','IG','IG', 'HY','IG']})
  
   df_result = pd.DataFrame({'Result':['HY','HY','IG', 'HY','IG'],'P':['IG','HY','IG',np.nan,'HY'], 'M':['HY','HY','IG', np.nan,'IG'], 'F':['HY',np.nan,'HY', np.nan,'IG'],'D':['IG','IG','IG', 'HY','IG']}
  </code></pre>