Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / doc / reference / glossary.rst @ 5cef0f13

History | View | Annotate | Download (2.08 KB)

1
.. _glossary:
2

    
3
Glossary
4
========
5

    
6
.. glossary::
7

    
8
   dictionary
9
      A Python dictionary maps keys to values. Also known as "hashes",
10
      or "associative arrays" in other programming languages.
11
      See https://docs.python.org/2/tutorial/datastructures.html#dictionaries
12

    
13
   edge
14
      Edges are either two-tuples of nodes `(u, v)` or three tuples of nodes
15
      with an edge attribute dictionary `(u, v, dict)`.
16

    
17
   ebunch
18
      An iteratable container of edge tuples like a list, iterator,
19
      or file.
20

    
21
   edge attribute
22
      Edges can have arbitrary Python objects assigned as attributes
23
      by using keyword/value pairs when adding an edge
24
      assigning to the `G.edges[u][v]` attribute dictionary for the
25
      specified edge *u*-*v*.
26

    
27
   hashable
28
      An object is hashable if it has a hash value which never changes
29
      during its lifetime (it needs a :meth:`__hash__` method), and can be
30
      compared to other objects (it needs an :meth:`__eq__` or :meth:`__cmp__`
31
      method). Hashable objects which compare equal must have the same
32
      hash value.
33

    
34
      Hashability makes an object usable as a dictionary key and a set
35
      member, because these data structures use the hash value internally.
36

    
37
      All of Python's immutable built-in objects are hashable, while no
38
      mutable containers (such as lists or dictionaries) are. Objects
39
      which are instances of user-defined classes are hashable by
40
      default; they all compare unequal, and their hash value is their
41
      :func:`id`.
42

    
43
      Definition from https://docs.python.org/2/glossary.html
44

    
45
   nbunch
46
      An nbunch is a single node, container of nodes or None (representing
47
      all nodes). It can be a list, set, graph, etc.. To filter an nbunch
48
      so that only nodes actually in `G` appear, use `G.nbunch_iter(nbunch)`.
49

    
50
   node
51
      A node can be any hashable Python object except None.
52

    
53
   node attribute
54
     Nodes can have arbitrary Python objects assigned as attributes
55
     by using keyword/value pairs when adding a node or
56
     assigning to the `G.nodes[n]` attribute dictionary for the
57
     specified node `n`.