title: Removing duplicate columns from a pandas dataframe: behavior of transpose + drop_duplicates
body: <p>So I was playing around with <code>drop_duplicates()</code>. Say I have a dataframe with duplicate columns:</p>
  
  <pre><code>In [9]:
  
  df1 = pd.DataFrame( data=nr.random((3,2)) )
  df1
  Out[9]:
  0   1
  0    0.441663    0.396479
  1    0.079502    0.715348
  2    0.692295    0.069418
  3 rows × 2 columns
  In [10]:
  
  df2 = pd.concat( ( df1, df1 ), axis=1 )
  df2
  Out[10]:
  0   1   0   1
  0    0.441663    0.396479    0.441663    0.396479
  1    0.079502    0.715348    0.079502    0.715348
  2    0.692295    0.069418    0.692295    0.069418
  3 rows × 4 columns
  In [11]:
  </code></pre>
  
  <p>I want to remove duplicate columns. The following works:</p>
  
  <pre><code>df2.T.drop_duplicates().T
  Out[12]:
  0   1
  0    0.441663    0.396479
  1    0.079502    0.715348
  2    0.692295    0.069418
  3 rows × 2 columns
  </code></pre>
  
  <p>However, this doesn't work:</p>
  
  <pre><code>df2.T.drop_duplicates( inplace=True )
  df2
  Out[11]:
  0   1   0   1
  0    0.441663    0.396479    0.441663    0.396479
  1    0.079502    0.715348    0.079502    0.715348
  2    0.692295    0.069418    0.692295    0.069418
  3 rows × 4 columns
  In [12]:
  </code></pre>
  
  <p>Why doesn't it work?</p>