I’m trying to get an adjacency matrix from a graph and do matrix operations. My code is as follows:
import igraph
import numpy as np
g = igraph.Graph.GRG(10,0.5)
Adj = np.array(sto.get_adjacency())
np.exp(Adj)
which gives me the error
AttributeError: 'Matrix' object has no attribute 'exp'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/Name/Desktop/Folder/main.py", line 18, in <module>
np.exp(Adj)
TypeError: loop of ufunc does not support argument 0 of type Matrix which has no callable exp method
I thought it’s because the type of argument is wrong. However, I checked that the type(Adj)
is the same as type(np.identity(3))
, and np.exp(np.identity(3))
works just fine. Any thoughts?
Thanks!