I am creating a graph from a numpy array where the values of the array elements represent weights. See code below. This graph clearly has one isolate. But why is the code for getting isolates not giving me an empty list.
import numpy
A=numpy.matrix([[3,0,1],[0,2,0], [0,0,5]])
G=nx.from_numpy_matrix(A, parallel_edges=False)
matrix([[3, 0, 1],
[0, 2, 0],
[0, 0, 5]])
nx.draw(G, node_color = 'green', node_size = 50, with_labels=False)
plt.show()
nx.degree(G)
4
nx.degree(G)
DegreeView({0: 3, 1: 2, 2: 3})
list(nx.isolates(G))
[]