title: Equality in Pandas DataFrames - Column Order Matters?
body: <p>As part of a unit test, I need to test two DataFrames for equality.  The order of the columns in the DataFrames is not important to me.  However, it seems to matter to Pandas:</p>
  
  <pre><code>import pandas
  df1 = pandas.DataFrame(index = [1,2,3,4])
  df2 = pandas.DataFrame(index = [1,2,3,4])
  df1['A'] = [1,2,3,4]
  df1['B'] = [2,3,4,5]
  df2['B'] = [2,3,4,5]
  df2['A'] = [1,2,3,4]
  df1 == df2
  </code></pre>
  
  <p>Results in:</p>
  
  <pre><code>Exception: Can only compare identically-labeled DataFrame objects
  </code></pre>
  
  <p>I believe the expression <code>df1 == df2</code> should evaluate to a DataFrame containing all <code>True</code> values.  Obviously it's debatable what the correct functionality of <code>==</code> should be in this context.  My question is: Is there a Pandas method that does what I want?  That is, is there a way to do equality comparison that ignores column order?</p>