title: Pandas Dataframe Comparison - specify mismatched columns
body: <p>I have two dataframes as shown below, <code>df1</code> and <code>df2</code>:</p>
  <pre><code>df1 =
              emp_name    emp_city    counts  
      emp_id              
      2       two         city2       3   
      4       fourxxx     city4       1   
      5       five        city5       1   
  
  df2 =
              emp_name    emp_city    counts  
      emp_id              
      2       two         city2       1   
      3       three       city3       1   
      4       four        city4       1   
  </code></pre>
  <p>Note: 'emp_id' acts as index.<br />
  I want to find the difference between <code>df1</code> and <code>df2</code> and write the name of the columns which has mismatched values. The below code snippet will do that.</p>
  <pre><code>df3 = df2.copy()
  df3['mismatch_col'] = df2.ne(df1, axis=1).dot(df2.columns)
  </code></pre>
  <p>Results in <code>df3</code>:</p>
  <pre><code>df3 = 
          emp_name    emp_city    counts  mismatch_col
  emp_id                  
  2       two         city2       1       counts
  3       three       city3       1       emp_nameemp_citycounts
  4       four        city4       1       emp_name
  </code></pre>
  <p>Now the problem I have is with respect to 'mismatch_col'. It is giving me the names of columns where there is a mismatch in <code>df1</code> and <code>df2</code>. But, the column names are NOT separated. I want to separate the column names by commas. Expected output should look like below:</p>
  <pre><code>Expected_df3 = 
              emp_name    emp_city    counts  mismatch_col
      emp_id                  
      2       two         city2       1       counts
      3       three       city3       1       emp_name,emp_city,counts
      4       four        city4       1       emp_name
  </code></pre>
  <p>Can someone please help me on this?</p>