title: Pandas combine duplicate columns that contain strings
body: <p>I'm having problems (sort of) with combining duplicate columns. It seems to work on older versions of Pandas/Python (not sure what the culprit is here), but not on the latest version. </p>
  
  <p>I basically have a dataframe of mixed values with duplicate column names after a concat. The values are either going to be a int, string, or nan. All non-nan values are going to be <em>the same for each duplicate column name</em>, so in theory max() should do the trick.</p>
  
  <p>Say I have the Dataframe:</p>
  
  <pre><code>    col1  col1  col2  col2  col3
  0   Foo   nan   nan   Bar   Baz
  1   nan   nan   Bar   Bar   nan
  2   0     nan   1     nan   1
  </code></pre>
  
  <p>My goal is to get</p>
  
  <pre><code>    col1  col2  col3
  0   Foo   Bar   Baz
  1   nan   Bar   nan
  2   0     1     1
  </code></pre>
  
  <p>Doing this</p>
  
  <pre><code>df.groupby(df.columns,axis=1).max()
  </code></pre>
  
  <p>Does exactly what I want it to do on a older version of Pandas/Python, but does not work for the latest. This is what I'm getting on the latest version:</p>
  
  <pre><code>    col1  col2  col3
  0   nan   nan   Baz
  1   nan   nan   nan
  2   0     1     1
  </code></pre>
  
  <p>Any ideas?</p>