Loaders¶
Pandas HDF5¶
Saving a Network to HDF5 is a way to share a Network or to preserve
it between sessions. For example. you can build a Network using the
OpenStreetMap API, then save the Network to HDF5 so you can reuse it
without querying OSM again.
Users will typically use the
save_hdf5() and
from_hdf5() methods.
Note
Only the nodes and edges of the network are saved.
Points-of-interest and data attached to nodes via the
set() method are not included.
You may find the Pandas HDFStore useful to save POI and other data.
When saving a Network to HDF5 it’s possible to exclude certain nodes.
This can be useful when refining a network so that it includes only
validated nodes.
(In the current design of pandarm it’s not possible to modify a
Network in place.)
As an example, you can use the
low_connectivity_nodes() method
to identify nodes that may not be connected to the larger network,
then exclude those nodes when saving to HDF5:
lcn = network.low_connectivity_nodes(10000, 10, imp_name='distance')
network.save_hdf5('mynetwork.h5', rm_nodes=lcn)
Pandas HDF5 API¶
- Network.save_hdf5(filename, rm_nodes=None, complevel=None, complib=None)[source]
Save network data to a Pandas HDF5 file.
Only the nodes and edges of the actual network are saved, points-of-interest and data attached to nodes are not saved.
- Parameters:
- filename
str - rm_nodesarray_like
A list, array, Index, or Series of node IDs that should not be saved as part of the Network.
- filename
- classmethod Network.from_hdf5(filename)[source]
Load a previously saved Network from a Pandas HDF5 file.
- Parameters:
- filename
str
- filename
- Returns:
- network
pandarm.Network
- network
- pandarm.loaders.pandash5.network_to_pandas_hdf5(network, filename, rm_nodes=None, complevel=None, complib=None)[source]¶
Save a Network’s data to a Pandas HDFStore.
- Parameters:
- network
pandarm.Network - filename
str - rm_nodesarray_like
A list, array, Index, or Series of node IDs that should not be saved as part of the Network.
- network