summaryrefslogtreecommitdiff
path: root/networkx/convert.py
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2020-11-25 18:22:49 -0800
committerGitHub <noreply@github.com>2020-11-25 18:22:49 -0800
commit37763df1db7238cd02af773d1897945dc2a970b5 (patch)
tree06c7c8bb92d9115a41cbdde848fea312510d2571 /networkx/convert.py
parent6149530a3ee76ad722749c7bd0c05a405f53172d (diff)
downloadnetworkx-37763df1db7238cd02af773d1897945dc2a970b5.tar.gz
Use matrix multiplication operator (#4390)
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Diffstat (limited to 'networkx/convert.py')
-rw-r--r--networkx/convert.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/networkx/convert.py b/networkx/convert.py
index 860d0868..3cc80e3c 100644
--- a/networkx/convert.py
+++ b/networkx/convert.py
@@ -133,9 +133,9 @@ def to_networkx_graph(data, create_using=None, multigraph_input=False):
# numpy matrix or ndarray
try:
- import numpy
+ import numpy as np
- if isinstance(data, (numpy.matrix, numpy.ndarray)):
+ if isinstance(data, (np.matrix, np.ndarray)):
try:
return nx.from_numpy_matrix(data, create_using=create_using)
except Exception as e: