title: Creating new dataframe based on maximum element
body: <p>I have two dataframes-</p>
  
  <pre><code>cols = ['A','B']
  data = [[-1,2],[0,2],[5,1]]
  data = np.asarray(data)
  indices = np.arange(0,len(data))
  
  df = pd.DataFrame(data, index=indices, columns=cols)
  
  cols = ['A','B']
  data2 = [[-13,2],[-1,2],[0,4],[2,1],[5,0]]
  data2 = np.asarray(data2)
  indices = np.arange(0,len(data2))
  
  df2 = pd.DataFrame(data2, index=indices, columns=cols)
  </code></pre>
  
  <p>Now I want to create a new dataframe which has for the same <code>A</code> the maximum of <code>B</code> from either dataframe.</p>
  
  <p>Therefore, the output would be-</p>
  
  <pre><code>    A   B
  0  -13  2
  1  -1   2
  2   0   4
  3   2   1
  4   5   1
  </code></pre>