# spaghetti.network.Network.savenetwork

Network.savenetwork(filename)

  Save a network to disk as a binary file.

  Parameters:
    filename `python:str`

      The filename where the network should be saved. This should be a full path or it will be saved in the current directory.

  Examples

  Create a network instance.

      >>> import spaghetti
      >>> from libpysal import examples
      >>> ntw = spaghetti.Network(examples.get_path("streets.shp"))

  Save out the network instance.

      >>> ntw.savenetwork("mynetwork.pkl")