summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAric Hagberg <aric.hagberg@gmail.com>2016-04-16 16:48:12 -0600
committerAric Hagberg <aric.hagberg@gmail.com>2016-04-16 16:48:12 -0600
commita7c9bf24cc737fe442d1edc63326f59b5d7bd0af (patch)
tree5709b0567d724e0484a0524cc238a01bf851bdc8
parent328d899fb17bac857eedd9ec3e03f4ede9b11c63 (diff)
downloadnetworkx-a7c9bf24cc737fe442d1edc63326f59b5d7bd0af.tar.gz
Document integer-only numeric mixing
The numeric mixing and assortativity algorithms only work for integers. They could be implemented to work for floating point numbers too.
-rw-r--r--networkx/algorithms/assortativity/correlation.py6
-rw-r--r--networkx/algorithms/assortativity/mixing.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/networkx/algorithms/assortativity/correlation.py b/networkx/algorithms/assortativity/correlation.py
index 6c56678e..d6b34f3d 100644
--- a/networkx/algorithms/assortativity/correlation.py
+++ b/networkx/algorithms/assortativity/correlation.py
@@ -190,13 +190,15 @@ def numeric_assortativity_coefficient(G, attribute, nodes=None):
Assortativity measures the similarity of connections
in the graph with respect to the given numeric attribute.
-
+ The numeric attribute must be an integer.
+
Parameters
----------
G : NetworkX graph
attribute : string
- Node attribute key
+ Node attribute key. The corresponding attribute value must be an
+ integer.
nodes: list or iterable (optional)
Compute numeric assortativity only for attributes of nodes in
diff --git a/networkx/algorithms/assortativity/mixing.py b/networkx/algorithms/assortativity/mixing.py
index 2c0e4f02..09886c74 100644
--- a/networkx/algorithms/assortativity/mixing.py
+++ b/networkx/algorithms/assortativity/mixing.py
@@ -166,13 +166,15 @@ def degree_mixing_matrix(G, x='out', y='in', weight=None,
def numeric_mixing_matrix(G,attribute,nodes=None,normalized=True):
"""Return numeric mixing matrix for attribute.
+ The attribute must be an integer.
+
Parameters
----------
G : graph
NetworkX graph object.
attribute : string
- Node attribute key.
+ Node attribute key. The corresponding attribute must be an integer.
nodes: list or iterable (optional)
Build the matrix only with nodes in container. The default is all nodes.