我在论坛上搜索过,我看到很多关于它的讨论,但没有什么是如此具体。 所以我有一个很长的json文件,我想在python中作为dictionary加载它,而不是list。 你可以在这里看到文件https://www.bicing.cat/availability_map/getJsonObject
这是我加载文件的代码,但每次运行时,都收到错误: TypeError:列表索引必须是整数,而不是str
import json
import requests
if __name__=='__main__':
response = requests.get("https://www.bicing.cat/availability_map /getJsonObject")
data=response.json()
print data["typeStation"][22]
使用pandas库处理类似表的数据:
返回以下内容:
哦还有一件事。。。我看到你在那里 我们可以编写一个geojson文件并将其绘制在地图上,然后将该文件放到地图上地理信息.io. 下面是一个函数:
结果:
相关问题 更多 >
编程相关推荐