0

Very new to programming - trying to get my code to take a list of order numbers from a spreadsheet then search them on an outside database. For now I'm just trying to get the "ONEA" column of my spreadsheet to incrementally print.

I think I'm miles off but the code below should at least explain what I'm trying to accomplish.


df = pd.read_excel('Test1.xlsx', sheet_name='Sheet1')

listONEA = df['ONEA']

# and what I'm trying to do is:

for i in range(10):
    print(listONEA[i])
    i =+ 1
cxlvinnn
  • 3
  • 1

1 Answers1

0

A pandas Series (your df['ONEA']) has a method .tolist

listONEA = df['ONEA'].tolist()

for i in listONEA:
  print(i)

Pandas DataFrame column to list

chucklukowski
  • 1,996
  • 2
  • 13
  • 13