AttributeError:“tuple”对象没有属性“low”connectivity“nodes”

2024-05-08 21:41:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试跟随“Pandana网络可访问性演示”Github repo(https://github.com/gboeing/urban-data-science/blob/master/20-Accessibility-Walkability/pandana-accessibility-demo-full.ipynb)。在

到目前为止,在复制和粘贴代码时,一切正常,但当我运行此程序时出现了一个问题:

start_time = time.time()
if os.path.isfile(net_filename):
    # if a street network file already exists, just load the dataset from that
    network = pandana.network.Network.from_hdf5(net_filename)
    method = 'loaded from HDF5'
else:
    # otherwise, query the OSM API for the street network within the specified bounding box
    network = osm.network_from_bbox(bbox[0], bbox[1], bbox[2], bbox[3])
    method = 'downloaded from OSM'

    # identify nodes that are connected to fewer than some threshold of other nodes within a given distance
    lcn = network.low_connectivity_nodes(impedance=1000, count=10, imp_name='distance')
    network.save_hdf5(net_filename, rm_nodes=lcn) #remove low-connectivity nodes and save to h5

print('Network with {:,} nodes {} in {:,.2f} secs'.format(len(network.node_ids), method, time.time()-start_time))

我得到的错误是:

^{pr2}$

Tags: thefromstreetnetifthattimenetwork