title: Calculate mode on a dataframe without sorting the result
body: <p>I have a data frame like this:</p>
  <pre><code>df = pd.DataFrame({'a1': [2,3,4,8,8], 'a2': [2,5,7,5,10], 'a3':[1,9,4,10,2]})
  
      a1  a2  a3
  0   2   2   1
  1   3   5   9
  2   4   7   4
  3   8   5   10
  4   8   10  2
  </code></pre>
  <p>The output should be:</p>
  <pre><code>0  2 
  1  3
  2  4
  3  8 
  4  8
  </code></pre>
  <p>What to do: I want to calculate mode row-wise, and if the mode is not present, I want the value from a1 (first column).</p>
  <p>For example: In second row <code>(3,5,9)</code>, the mode is not present so I get <code>3</code> in output.</p>
  <h2><strong>Note: I've already tried <code>df.mode(axis=1)</code> but that seems to shuffle the sequence of values row wise, so I don't always get the value of first column in the output.</strong></h2>