title: Reference next row value using Pandas
body: <p>I am writing a script to fill out forms and would like to reference data from an Excel spreadsheet(one column) to fill in a reoccurring field.</p>
  
  <pre><code>import pandas as pd
  
  file = 'File Path Here'
  
  xl = pd.ExcelFile(file)
  
  df = pd.read_excel(file, 'Sheet1', index_col=None)
  
  num = 1
  
  li = [(df.iloc[0,0])]
  
  
  def next_app():
      for num, elem in enumerate(li):
          thiselem = elem
          nextelem = li[(num + 1) % len(li)]
          print(nextelem)
  
  next_app()
  </code></pre>
  
  <p>This obviously <em>prints</em> 1 value but I am not sure how to call each row value after the next whenever I need to. I am sure there are mistakes in the for loop or if I even need a for loop, but I am not sure how to rectify that.</p>
  
  <p>The Excel file contains one text column named 'Application' with over 300 rows:</p>
  
  <p>|Application|</p>
  
  <p>|Appname1|</p>
  
  <p>|Appname2|</p>
  
  <p>|Appname3|</p>
  
  <p>Etc.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>I would like to reference each 'Appname' one by one when coming across a form field like the following(I am using selenium to accomplish this):</p>
  
  <pre><code>name = browser.find_element_by_id('slpt-createappdialog-app-name-inputEl')
  name.send_keys('Appname3')
  </code></pre>
  
  <p>Except instead of inputting the text 'AppnameX' every time, I would call on the next row value. Is this possible to do?</p>