summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/algorithms/plot_rcm.py2
-rw-r--r--networkx/algorithms/assortativity/correlation.py2
-rw-r--r--networkx/algorithms/shortest_paths/dense.py4
-rw-r--r--networkx/algorithms/similarity.py6
-rw-r--r--networkx/classes/digraph.py8
-rw-r--r--networkx/classes/graph.py8
-rw-r--r--networkx/classes/multidigraph.py8
-rw-r--r--networkx/classes/multigraph.py8
-rw-r--r--networkx/convert.py5
-rw-r--r--networkx/linalg/laplacianmatrix.py2
10 files changed, 26 insertions, 27 deletions
diff --git a/examples/algorithms/plot_rcm.py b/examples/algorithms/plot_rcm.py
index 91e7665e..fc08739b 100644
--- a/examples/algorithms/plot_rcm.py
+++ b/examples/algorithms/plot_rcm.py
@@ -15,7 +15,7 @@ import seaborn as sns
import networkx as nx
-# build low-bandwidth numpy matrix
+# build low-bandwidth matrix
G = nx.grid_2d_graph(3, 3)
rcm = list(nx.utils.reverse_cuthill_mckee_ordering(G))
print("ordering", rcm)
diff --git a/networkx/algorithms/assortativity/correlation.py b/networkx/algorithms/assortativity/correlation.py
index 39ac2fab..b8f884e9 100644
--- a/networkx/algorithms/assortativity/correlation.py
+++ b/networkx/algorithms/assortativity/correlation.py
@@ -281,7 +281,7 @@ def attribute_ac(M):
def numeric_ac(M, mapping):
- # M is a numpy matrix or array
+ # M is a 2D numpy array
# numeric assortativity coefficient, pearsonr
import numpy as np
diff --git a/networkx/algorithms/shortest_paths/dense.py b/networkx/algorithms/shortest_paths/dense.py
index 818921ca..89651718 100644
--- a/networkx/algorithms/shortest_paths/dense.py
+++ b/networkx/algorithms/shortest_paths/dense.py
@@ -35,8 +35,8 @@ def floyd_warshall_numpy(G, nodelist=None, weight="weight"):
Returns
-------
- distance : NumPy matrix
- A matrix of shortest path distances between nodes.
+ distance : 2D numpy.ndarray
+ A numpy array of shortest path distances between nodes.
If there is no path between two nodes the value is Inf.
Notes
diff --git a/networkx/algorithms/similarity.py b/networkx/algorithms/similarity.py
index 9966d76a..cc6d646a 100644
--- a/networkx/algorithms/similarity.py
+++ b/networkx/algorithms/similarity.py
@@ -1421,12 +1421,12 @@ def _simrank_similarity_numpy(
Returns
-------
- similarity : numpy matrix, numpy array or float
+ similarity : numpy array or float
If ``source`` and ``target`` are both ``None``, this returns a
- Matrix containing SimRank scores of the nodes.
+ 2D array containing SimRank scores of the nodes.
If ``source`` is not ``None`` but ``target`` is, this returns an
- Array containing SimRank scores of ``source`` and that
+ 1D array containing SimRank scores of ``source`` and that
node.
If neither ``source`` nor ``target`` is ``None``, this returns
diff --git a/networkx/classes/digraph.py b/networkx/classes/digraph.py
index 498c333c..336daab6 100644
--- a/networkx/classes/digraph.py
+++ b/networkx/classes/digraph.py
@@ -38,8 +38,8 @@ class DiGraph(Graph):
Data to initialize graph. If None (default) an empty
graph is created. The data can be any format that is supported
by the to_networkx_graph() function, currently including edge list,
- dict of dicts, dict of lists, NetworkX graph, NumPy matrix
- or 2d ndarray, SciPy sparse matrix, or PyGraphviz graph.
+ dict of dicts, dict of lists, NetworkX graph, 2D NumPy array, SciPy
+ sparse matrix, or PyGraphviz graph.
attr : keyword arguments, optional (default= no attributes)
Attributes to add to graph as key=value pairs.
@@ -274,8 +274,8 @@ class DiGraph(Graph):
Data to initialize graph. If None (default) an empty
graph is created. The data can be an edge list, or any
NetworkX graph object. If the corresponding optional Python
- packages are installed the data can also be a NumPy matrix
- or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.
+ packages are installed the data can also be a 2D NumPy array, a
+ SciPy sparse matrix, or a PyGraphviz graph.
attr : keyword arguments, optional (default= no attributes)
Attributes to add to graph as key=value pairs.
diff --git a/networkx/classes/graph.py b/networkx/classes/graph.py
index d296bf3b..6c082176 100644
--- a/networkx/classes/graph.py
+++ b/networkx/classes/graph.py
@@ -39,8 +39,8 @@ class Graph:
Data to initialize graph. If None (default) an empty
graph is created. The data can be any format that is supported
by the to_networkx_graph() function, currently including edge list,
- dict of dicts, dict of lists, NetworkX graph, NumPy matrix
- or 2d ndarray, SciPy sparse matrix, or PyGraphviz graph.
+ dict of dicts, dict of lists, NetworkX graph, 2D NumPy array, SciPy
+ sparse matrix, or PyGraphviz graph.
attr : keyword arguments, optional (default= no attributes)
Attributes to add to graph as key=value pairs.
@@ -295,8 +295,8 @@ class Graph:
Data to initialize graph. If None (default) an empty
graph is created. The data can be an edge list, or any
NetworkX graph object. If the corresponding optional Python
- packages are installed the data can also be a NumPy matrix
- or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.
+ packages are installed the data can also be a 2D NumPy array, a
+ SciPy sparse matrix, or a PyGraphviz graph.
attr : keyword arguments, optional (default= no attributes)
Attributes to add to graph as key=value pairs.
diff --git a/networkx/classes/multidigraph.py b/networkx/classes/multidigraph.py
index b53fecf1..ee24ac55 100644
--- a/networkx/classes/multidigraph.py
+++ b/networkx/classes/multidigraph.py
@@ -38,8 +38,8 @@ class MultiDiGraph(MultiGraph, DiGraph):
Data to initialize graph. If None (default) an empty
graph is created. The data can be any format that is supported
by the to_networkx_graph() function, currently including edge list,
- dict of dicts, dict of lists, NetworkX graph, NumPy matrix
- or 2d ndarray, SciPy sparse matrix, or PyGraphviz graph.
+ dict of dicts, dict of lists, NetworkX graph, 2D NumPy array, SciPy
+ sparse matrix, or PyGraphviz graph.
multigraph_input : bool or None (default None)
Note: Only used when `incoming_graph_data` is a dict.
@@ -288,8 +288,8 @@ class MultiDiGraph(MultiGraph, DiGraph):
Data to initialize graph. If incoming_graph_data=None (default)
an empty graph is created. The data can be an edge list, or any
NetworkX graph object. If the corresponding optional Python
- packages are installed the data can also be a NumPy matrix
- or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.
+ packages are installed the data can also be a 2D NumPy array, a
+ SciPy sparse matrix, or a PyGraphviz graph.
multigraph_input : bool or None (default None)
Note: Only used when `incoming_graph_data` is a dict.
diff --git a/networkx/classes/multigraph.py b/networkx/classes/multigraph.py
index 343befa4..07436ebd 100644
--- a/networkx/classes/multigraph.py
+++ b/networkx/classes/multigraph.py
@@ -32,8 +32,8 @@ class MultiGraph(Graph):
Data to initialize graph. If None (default) an empty
graph is created. The data can be any format that is supported
by the to_networkx_graph() function, currently including edge list,
- dict of dicts, dict of lists, NetworkX graph, NumPy matrix
- or 2d ndarray, SciPy sparse matrix, or PyGraphviz graph.
+ dict of dicts, dict of lists, NetworkX graph, 2D NumPy array,
+ SciPy sparse matrix, or PyGraphviz graph.
multigraph_input : bool or None (default None)
Note: Only used when `incoming_graph_data` is a dict.
@@ -297,8 +297,8 @@ class MultiGraph(Graph):
Data to initialize graph. If incoming_graph_data=None (default)
an empty graph is created. The data can be an edge list, or any
NetworkX graph object. If the corresponding optional Python
- packages are installed the data can also be a NumPy matrix
- or 2d ndarray, a SciPy sparse matrix, or a PyGraphviz graph.
+ packages are installed the data can also be a 2D NumPy array, a
+ SciPy sparse matrix, or a PyGraphviz graph.
multigraph_input : bool or None (default None)
Note: Only used when `incoming_graph_data` is a dict.
diff --git a/networkx/convert.py b/networkx/convert.py
index 593eb1bc..c7468b84 100644
--- a/networkx/convert.py
+++ b/networkx/convert.py
@@ -55,8 +55,7 @@ def to_networkx_graph(data, create_using=None, multigraph_input=False):
iterator (e.g. itertools.chain) that produces edges
generator of edges
Pandas DataFrame (row per edge)
- numpy matrix
- numpy ndarray
+ 2D numpy array
scipy sparse matrix
pygraphviz agraph
@@ -144,7 +143,7 @@ def to_networkx_graph(data, create_using=None, multigraph_input=False):
return nx.from_numpy_array(data, create_using=create_using)
except Exception as err:
raise nx.NetworkXError(
- "Input is not a correct numpy matrix or array."
+ f"Failed to interpret array as an adjacency matrix."
) from err
except ImportError:
warnings.warn("numpy not found, skipping conversion test.", ImportWarning)
diff --git a/networkx/linalg/laplacianmatrix.py b/networkx/linalg/laplacianmatrix.py
index 4fe3daaa..e1986ec9 100644
--- a/networkx/linalg/laplacianmatrix.py
+++ b/networkx/linalg/laplacianmatrix.py
@@ -367,7 +367,7 @@ def _transition_matrix(G, nodelist=None, weight="weight", walk_type=None, alpha=
Returns
-------
- P : NumPy matrix
+ P : numpy.ndarray
transition matrix of G.
Raises