title: Python Pandas df is not defined
body: <p>I have a problem with a script I wrote a while back, couple of months ago it worked fine without problem. However since then the OS has been updated.
  The script works fine until it tries to create a dataframe with pandas</p>
  
  <pre><code>import os
  import pandas as pd
  import matplotlib.pyplot as plt
  
  dir_input = '/home/xxx/xxx/xxx/Script/input/'
  osdir = []
  alldir = []
  for all_files in os.listdir(dir_input):
      alldir.append(all_files)
  for file in os.listdir(dir_input): #Adds all the specified files to the list osdir
      if file.endswith('.xlsx'):
      osdir.append(file)
      print("Found {0}".format(file))
  
  for filename in osdir:
      (fileroot, extension) = os.path.splitext(filename)
      print 'Processing file...'
      print fileroot
      print ''
      # pandas works with so called dataframes to import the data. Since I dont need all the columns we only use column d,f and j
      df = pd.read_excel(dir_input+filename,parse_cols="D,F,J", index=df.index)
  ...
  </code></pre>
  
  <p>The error I get using spyder</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-5-2cf9c86bcb8c&gt;", line 1, in &lt;module&gt;
  runfile('/home/xxx/python_scripts/xpos-frame-mean_batch_v1.1.py', wdir='/home/cdoering/python_scripts')
  
    File "/home/xxx/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 682, in runfile
  execfile(filename, namespace)
  
    File "/home/xxx/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 78, in execfile
  builtins.execfile(filename, *where)
  
    File "/home/xxx/python_scripts/script.py", line 54, in &lt;module&gt;
  df = pd.read_excel(dir_input+filename,parse_cols="D,F,J", index=df.index)
  
  NameError: name 'df' is not defined
  </code></pre>
  
  <p>My feeling is there is something wrong with pandas, maybe? I uninstalled it using conda and reinstalled it. Tried uninstalling with pip, but never used pip to install it so it couldn't find it. I am at a loss.</p>