大家好,我正在尝试将输入从csv文件传递到我的url,该文件包含数百万条记录,因此响应非常慢。这需要很多时间,有时会超时。有人能帮我加快速度吗?我可以提供代码,但不能提供数据和url,因为这是机密信息。 这是我的密码:
import pandas as pd
import requests
import json
from pandas.io.json import json_normalize
from flatten_json import flatten
df=pd.read_excel('C:/data1.xlsx',index=None,index_col=None,encoding='UTF-8')
df.head(5)
df.shape
df=df[['NAME','country']]
df.head(5)
passwd=b"abc"
user=b"xxxxx"
# Make a request to the endpoint using the correct auth values
auth_values = (user,passwd)
dd=df.values
dfj = pd.DataFrame()
for i,j in dd:
url='http:xyz.com/&name='+str(i)+'&country='+str(j)
resp = requests.get(url,auth=auth_values)
r=resp.json()
提前谢谢你的帮助
enter code here
试试这个来穿线
相关问题 更多 >
编程相关推荐