title: How to avoid `Unnamed` columns during read.csv using pandas?
body: <p>I have 20-30 csv files to be read.</p>
  <p>So, I try the below code</p>
  <pre><code>pat_dir = ['file*.csv']
  files_grabbed = []
  for files in pat_dir:
      files_grabbed.extend(glob.glob(files))
  for f in files_grabbed:
      df = pd.read_csv(f, sep=&quot;,&quot;,low_memory=False)
      print(f)
      print(df.columns)
  </code></pre>
  <p>And printing them gives an output like below</p>
  <pre><code>file1.csv
  Index(['Date', 'Code', 'Test', 'value', 'unit', 'TextualResults',
         'subject_id', 'class_id', 'Unnamed: 8',
         'Unnamed: 9', 'Unnamed: 10', 'Unnamed: 11', 'Unnamed: 12',
         'Unnamed: 13', 'Unnamed: 14', 'Unnamed: 15', 'Unnamed: 16',
         'Unnamed: 17', 'Unnamed: 18', 'Unnamed: 19', 'Unnamed: 20',
         'Unnamed: 21', 'Unnamed: 22', 'Unnamed: 23', 'Unnamed: 24',
         'Unnamed: 25', 'Unnamed: 26', 'Unnamed: 27', 'Unnamed: 28',
         'Unnamed: 29', 'Unnamed: 30', 'Unnamed: 31', 'Unnamed: 32',
         'Unnamed: 33', 'Unnamed: 34', 'Unnamed: 35', 'Unnamed: 36',
         'Unnamed: 37', 'Unnamed: 38', 'Unnamed: 39', 'Unnamed: 40',
         'Unnamed: 41', 'Unnamed: 42', 'Unnamed: 43', 'Unnamed: 44',
         'Unnamed: 45', 'Unnamed: 46', 'Unnamed: 47', 'Unnamed: 48',
         'Unnamed: 49', 'Unnamed: 50'],
  </code></pre>
  <p>While I can avoid the <code>unnamed</code> columns after read.csv using below code</p>
  <pre><code>df = df.loc[:, ~df.columns.str.contains('^Unnamed')]
  </code></pre>
  <p>How can I avoid reading those <code>unnamed</code> column during <code>read.csv</code> operation?</p>
  <p>Please note that I don't know the column names before hand. So, I can't define <code>column names</code> to read.csv. because each file can have different column names</p>
  <p>So, is there any way to  drop them during read.csv operation because I have 30 files, and this causes issues during <code>glob</code> operation?</p>