Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Need to read a dataframe line by line

$
0
0

@sachin123456 wrote:

Hi, I have a requirement to process the Excel file.
Have taken this file to dataframe.
Now I need to process each line by line from dataframe.

Here is what I am doing

for index, row in df.iterrows():

 headers  = {"Content-Type": "application/json"}

from requests.auth import HTTPBasicAuth
r=requests.post(‘URL’, auth=HTTPBasicAuth(‘Username’, ‘Pass’),headers=headers, data=json.dumps({
‘name’:row[“Name”],
‘domainId’:‘7319ca59-f9d4-4f86-9eaf-a359691b378b’,
‘typeId’:‘00000000-0000-0000-0000-000000011001’
}))
print(r.text)

Here the ‘0’ th Index is escaping and next line is taking.(First line in dataFrame)

May I know what is the reason.

Thanks in Advance

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles