title: Python Pandas: NameError: name is not defined
body: <p>Ok, this is my first Python Pandas program and I'm having a hard time figuring out what the column name is so I can reference it in a function call.</p>
  
  <p>Below is my code. parseDeviceType is calling a function to parse useragentstring. But when I call it using what I think the column name is, I get an error that name is not defined:</p>
  
  <pre><code>df = pd.read_csv('user_agent_strings.txt',index_col=None, na_values=['NA'],sep=',')
  dt=parseDeviceType(user_agent_string)
  print df.columns
  
  NameError: name 'user_agent_string' is not defined
  Index([u'user_agent_string'], dtype='object')
  </code></pre>
  
  <p>And here's the  header and first row of data from the input file containing the useragentstrings:</p>
  
  <pre><code>"user_agent_string"
  "Mozilla/5.0 (iPad; CPU OS 7_1_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D201 Safari/9537.53"
  </code></pre>
  
  <p>Can you help me understand how to reference the column name in the <code>dt=parseDeviceType(user_agent_string)</code> call? I'd like to also know how to reference it by column number if that is possible in a call to a function.</p>
  
  <p>Thanks</p>