# ``igraph`.`DyadCensus``

class documentation

`class DyadCensus(tuple): (source)`

View In Hierarchy

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', ...)]

Method | `__getattr__` | Undocumented
Method | `__getitem__` | Undocumented
Method | `__repr__` | Undocumented
Method | `__str__` | Undocumented
Method | `as_dict` | Converts the dyad census to a dict using the known dyad names.
Class Variable | `_remap` | Undocumented

def __getattr__(self, attr): (source)

Undocumented

def __getitem__(self, idx): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def __str__(self): (source)

Undocumented

def as_dict(self): (source)

Converts the dyad census to a dict using the known dyad names.

_remap: `dict[str, int]` = (source)

Undocumented