python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Module datatypes :: Class DyadCensus
[hide private]

Class DyadCensus

source code

object --+    
         |    
     tuple --+
             |
            DyadCensus

Dyad census of a graph.

This is a pretty simple class - basically it is a tuple, but it allows the user to refer to its individual items by the names mutual (or mut), asymmetric (or asy or asym or asymm) and null.

Examples:

>>> from igraph import Graph
>>> g=Graph.Erdos_Renyi(100, 0.2, directed=True)
>>> dc=g.dyad_census()
>>> print dc.mutual             #doctest:+SKIP
179
>>> print dc["asym"]            #doctest:+SKIP
1609
>>> print tuple(dc), list(dc)   #doctest:+SKIP
(179, 1609, 3162) [179, 1609, 3162]
>>> print sorted(dc.as_dict().items())   #doctest:+ELLIPSIS
[('asymmetric', ...), ('mutual', ...), ('null', ...)]
Instance Methods [hide private]
 
__getitem__(self, idx)
x[y]
source code
 
__getattr__(self, attr) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
as_dict(self)
Converts the dyad census to a dict using the known dyad names.
source code

Inherited from tuple: __add__, __contains__, __eq__, __ge__, __getattribute__, __getnewargs__, __getslice__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __rmul__, count, index

Inherited from object: __delattr__, __format__, __init__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getitem__(self, idx)
(Indexing operator)

source code 

x[y]

Overrides: tuple.__getitem__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

   Home       Trees       Indices       Help