I am trying to calculate the basic stats of a graph created from a gdf using the following code:
ox.utiles_graph.graph_from_gdf(n,e)
Nodes and edges have been saved previously and resulted from:
G = graph.graph_from_place(some_place_name)
n,e = ox.graph_to_gdfs(G)
n.save_to_file(filname,driver="ESRI Shapefile")
e.save_to_file(filname,driver="ESRI Shapefile")
I can plot the graph and also calculate travel times from it but I am unable to use the basic stats function. I get the following error:
---> 56 ox.basic_stats(G)
~/anaconda3/envs/ox/lib/python3.9/site-packages/osmnx/stats.py in basic_stats(G, area, clean_int_tol, clean_intersects, tolerance, circuity_dist)
346 stats["edge_length_avg"] = stats["edge_length_total"] / stats["m"]
347 stats["streets_per_node_avg"] = streets_per_node_avg(G)
--> 348 stats["streets_per_node_counts"] = streets_per_node_counts(G)
349 stats["streets_per_node_proportions"] = streets_per_node_proportions(G)
350 stats["intersection_count"] = intersection_count(G)
~/anaconda3/envs/ox/lib/python3.9/site-packages/osmnx/stats.py in streets_per_node_counts(G)
80 """
81 spn_vals = list(streets_per_node(G).values())
---> 82 return {i: spn_vals.count(i) for i in range(int(max(spn_vals)) + 1)}
83
84
ValueError: max() arg is an empty sequence
Any clue how I can soleve this?