Home > Back-end >  How to read excel line by line in pandas
How to read excel line by line in pandas

Time:12-05

I want to ask how can How to read excel line by line in pandas. I want it to be in a loop that will get line by line information for facebook login with selenium. Hope everyone is easygoing because I'm a newbie

import pandas as pd

pd.options.display.max_rows = 28
data = pd.read_excel(r'file.xlsx')

#load data into a DataFrame object:
df = pd.DataFrame(data)
username = pd.DataFrame(f1,columns=['Name'])
password = pd.DataFrame(f1,columns=['Pass'])

for i in df:
    print('Current row:', i)

CodePudding user response:

Is it important that you read your Excel file line-by-line? Or is it also okay for you to read the entirety of your Excel file into a Dataframe and just iterate through that?

CodePudding user response:

since you're new to programming, a good counsel I can give is to read and search the documentation when doubts first appear. Many tools even have tutorials to help you start coding and search to help you find basic code. Check this link, I think it will help a lot! https://pandas.pydata.org/docs/getting_started/intro_tutorials/02_read_write.html?highlight=read excel

  • Related