![](https://i-blog.csdnimg.cn/blog_migrate/6c5deb2d09452d4e95705ba106d2d9a1.png)
现将存储在excel表中的详细地址导入,然后通过百度地图API查询各个地点的坐标经纬度,并将数据保存到csv文件中备用
'''
调用百度地图API,批量输入地址查询坐标经纬度
'''
import pandas as pd
import json
import requests
data=pd.read_excel("schools_bantian.xlsx")
print(data.loc[0,"地址"])
ak = 'duaE7gEWkw9LUCnkX1GDf4jo2nGyL84H'
from urllib.request import urlopen, quote
import requests
def getlnglat(address):
url = 'http://api.map.baidu.com/geocoder/v2/'
output = 'json'
ak = 'duaE7gEWkw9LUCnkX1GDf4jo2nGyL84H'
address = quote(address)
uri = url + '?' + 'address=' + address + '&output=' &