title: Comparing all column names of multiple Pandas Dataframes
body: <p>I am looking for an easier way to compare multiple column names with a similar output to the code below or a way to make this function more concise. I get the errors &quot;IndexError: list index out of range&quot; or &quot;function takes 0 positional arguments but 1 was given&quot; every time I try to use *args or **Kwargs to simplify the function. Any advice is greatly appreciated.</p>
  <p>'''</p>
  <pre><code>application_df = pd.read_csv(&quot;application_train.csv&quot;)
  bureau_df = pd.read_csv(&quot;bureau.csv&quot;)
  bureau_balance_df = pd.read_csv(&quot;bureau_balance.csv&quot;)
  previous_application_df = pd.read_csv(&quot;previous_application.csv&quot;)
  POS_CASH_balance_df = pd.read_csv(&quot;POS_CASH_balance.csv&quot;)
  installments_payments_df = pd.read_csv(&quot;installments_payments.csv&quot;)
  credit_card_balance_df = pd.read_csv(&quot;credit_card_balance.csv&quot;)
  sample__submission_df = pd.read_csv(&quot;sample_submission.csv&quot;)
  
  def column_compare(df1, df2, df3, df4, df5, df6, df7, df8):
      alist = []
      blist = []
      clist = []
      dlist = []
      elist = []
      flist = []
      glist = []
      hlist = []
      
      name1 =[x for x in globals() if globals()[x] is df1][0]
      for a in df1:
          alist.append(a)
          
      name2 =[x for x in globals() if globals()[x] is df2][0]
      for b in df2:
          blist.append(b)
          
      name3 =[x for x in globals() if globals()[x] is df3][0]
      for c in df3:
          clist.append(c)
          
      name4 =[x for x in globals() if globals()[x] is df4][0]
      for d in df4:
          dlist.append(d)
          
      name5 =[x for x in globals() if globals()[x] is df5][0]
      for e in df5:
          elist.append(e)
          
      name6 =[x for x in globals() if globals()[x] is df6][0]
      for f in df6:
          flist.append(f)
          
      name7 =[x for x in globals() if globals()[x] is df7][0]
      for g in df7:
          glist.append(g)
          
      name8 =[x for x in globals() if globals()[x] is df8][0]
      for h in df8:
          hlist.append(h)
          
      dfs = {name1: alist, name2: blist, name3: clist, name4: dlist, name5: elist, name6: flist, name7: glist, name8: hlist}
      df = pd.DataFrame.from_dict(dfs, orient='index')
      df=df.transpose().replace(np.nan,'')
      return df
  
  pd.set_option(&quot;max_rows&quot;, None)
  column_names = column_compare(application_df, bureau_df, bureau_balance_df, previous_application_df, POS_CASH_balance_df, installments_payments_df, credit_card_balance_df, sample__submission_df)
  column_names
  </code></pre>
  <p>'''</p>