上下文:我正在尝试运行另一位研究人员的代码 - 它描述了湾区道路网络的交通模型,该模型受地震危险的影响。我是 Python 的新手,因此非常感谢调试以下错误的一些帮助。
问题:当我尝试按照自述文件中的说明运行随文件提供的示例数据的代码时,出现以下错误。
DN0a226926:quick_traffic_model gitanjali$ python mahmodel_road_only.py
You are considering 2 ground-motion intensity maps.
You are considering 1743 different site locations.
You are considering 2 different damage maps (1 per ground-motion intensity map).
Traceback (most recent call last):
File "mahmodel_road_only.py", line 288, in <module>
main()
File "mahmodel_road_only.py", line 219, in main
G = get_graph()
File "mahmodel_road_only.py", line 157, in get_graph
G = add_superdistrict_centroids(G)
File "mahmodel_road_only.py", line 46, in add_superdistrict_centroids
G.add_node(str(1000000 + i))
File "/Library/Python/2.7/site-packages/networkx-2.0-py2.7.egg/networkx/classes/digraph.py", line …Run Code Online (Sandbox Code Playgroud)