Package igraph :: Module datatypes :: Class DyadCensus
[hide private]
[frames] | no frames]

Class DyadCensus

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:

>>> g=Graph.Erdos_Renyi(100, 0.2, directed=True)
>>> dc=g.dyad_census()
>>> print dc.mutual
179
>>> print dc["asym"]
1609
>>> print tuple(dc), list(dc)
(179, 1609, 3162) [179, 1609, 3162]
>>> print dc.as_dict()
{"mutual": 179, "asymmetric": 1609, "null": 3162}
Instance Methods [hide private]
 
__getattr__(self, attr)
 
__getitem__(self, idx)
x[y]
 
__repr__(self)
repr(x)
 
__str__(self)
str(x)
 
as_dict(self)
Converts the dyad census to a dict using the known dyad names.

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

Inherited from object: __delattr__, __init__, __reduce__, __reduce_ex__, __setattr__

Class Variables [hide private]
  _remap = {'asy': 1, 'asym': 1, 'asymm': 1, 'asymmetric': 1, 'm...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getitem__(self, idx)
(Indexing operator)

 

x[y]

Overrides: tuple.__getitem__
(inherited documentation)

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

Class Variable Details [hide private]

_remap

Value:
{'asy': 1,
 'asym': 1,
 'asymm': 1,
 'asymmetric': 1,
 'mut': 0,
 'mutual': 0,
 'null': 2,
 'sym': 0,
...