title: Why do I get "NameError: name 'df' is not defined"?
body: <p>I don't know why "df" is not defined because i already assigned df a value. I read some question and answers online regarding this matter but none seem to help me solve my problem. If i remove the code to use CUDA, it runs perfectly but the project i'm working on requires for me to use CUDA.</p>
  
  <pre><code>@nb.jit(nopython=True)
  def func_nb():
      data = pd.read_csv('dummycsv.csv')
      df = DataFrame(data)
      df['Tag'] = df['Tag'].map(lambda x: re.sub(r'\W+', '_', x))
  tempdata = pd.DataFrame(columns=['Time','Value'])
  
  taglist = pd.read_excel('dummyexcel.xlsx')
  dt = DataFrame(taglist, columns=['Tag'])
  dt['Tag'] = dt['Tag'].map(lambda x: re.sub(r'\W+', '_', x))
  
  
  for i,row in dt.iterrows(): 
  
     tempdata = tempdata[0:0]      
     for index,row in df.iterrows():
  
         tag = dt.iloc[i]['Tag'] 
         x = df.iloc[index]['Tag']
         val = df.iloc[index]
  </code></pre>
  
  <p>Expected results are new files being created as a result from reading both excel and csv file and filtering the data in them.</p>
  
  <p>Any help would be greatly appreciated!</p>