8.4.1 How do I convert a pedigree to a graph?

The function pyp_network.ped_to_graph() takes a PyPedal pedigree object as its argument and returns a NetworkX (https://networkx.lanl.gov/) XDiGraph object:
example = pyp_newclasses.loadPedigree(optionsfile='new_networkx.ini')
ng = pyp_network.ped_to_graph(example)
Once you've got a graph, you use the NetworkX API to operate on the graph. For example, the number of animals in the pedigree is simply the number of nodes in the graph:
print 'Number of animals in pedigree: %s' % ( ng.order() )
print ng.nodes()
See About this document... for information on suggesting changes.