title: Getting the following Error: FileNotFoundError: [WinError 3] The system cannot find the path specified:
body: <p>I am new with Python and I am attempting to extract a specific column from a csv file (Column name = &quot;Hostname&quot;). I keep getting error: <strong>FileNotFoundError: [WinError 3] The system cannot find the path specified</strong>:</p>
  <p>#################################################</p>
  <pre><code>import os
  
  import pandas as pd
  
  data_location = pd.read_csv(r'C:\\Users\\Marco A\\Desktop\\csv_files\\Status_CS.csv')
  
  df_total = pd.DataFrame(columns=[&quot;Hostname&quot;])
  
  for file in os.listdir(str(data_location)):
  
      df_file = pd.read_csv(data_location + file)
      selected_columns = df_file.loc[:, df_total]
      df_total = pd.concat([selected_columns, df_total], ignore_index=False)
  
  df_total.to_csv(&quot;ValuableColumns.csv&quot;, index=False)
  </code></pre>
  <p>Error states its in line 10 (&quot;<strong>for file in os.listdir(str(data_location)):</strong>&quot;) I have also attempted the following code in line 10 &quot;<strong>for file in os.listdir(data_location):</strong> however, I get the following error:</p>
  <p>line 11, in 
  for file in os.listdir(data_location):
  TypeError: listdir: path should be string, bytes, os.PathLike or None, not DataFrame</p>
  <p>Not quite sure how to proceed. Please point me to the right direction.</p>