spacenet.utils.nodes_to_dataframe#

spacenet.utils.nodes_to_dataframe(spatial_network)#

Converts the nodes of a spatial network into a pandas DataFrame. The resulting DataFrame is indexed by node ids and has columns for each attribute of the nodes in the graph. If an attribute is missing for a node, the corresponding cell will be filled with NaN.

Parameters:
spatial_networkNetworkX graph

The spatial network for which to create the node dataframe.

Returns:
node_dfpandas DataFrame

A dataframe indexed by node ids with columns for each attribute of the nodes in the graph. If an attribute is missing for a node, the corresponding cell will be filled with NaN.