Closed Gustarvo closed 4 years ago
TypeError Traceback (most recent call last) <ipython-input-46-e1ce7f47f2f6> in <module>() ----> 1 my_graph = gv.graph.Graph.load(edge_list) TypeError: load(): incompatible function arguments. The following argument types are supported: 1. (self: libgraphvite.graph.Graph, file_name: str, as_undirected: bool = True, normalization: bool = False, delimiters: str = ' \t\r\n', comment: str = '#') -> None 2. (self: libgraphvite.graph.Graph, edge_list: List[Tuple[str, str]], as_undirected: bool = True, normalization: bool = False) -> None 3. (self: libgraphvite.graph.Graph, weighted_edge_list: List[Tuple[str, str, float]], as_undirected: bool = True, normalization: bool = False) -> None Invoked with: [('65', '1378'), ('65', '1378'), ('65', '1378'), ('65', '1378'), ('65', '1378'), ('65', '1378'), ('65', '1378'), ('65', '1378'), ('65', '1378')...
the edge_list is a list made of tuple but i can`t load the list as a graph
I also tried saving the list in a file and load it ,but it failed either with same typeerror.
my_graph = gv.graph.Graph.load("edge_list.json") TypeError: load(): incompatible function arguments. The following argument types are supported: 1. (self: libgraphvite.graph.Graph, file_name: str, as_undirected: bool = True, normalization: bool = False, delimiters: str = ' \t\r\n', comment: str = '#') -> None 2. (self: libgraphvite.graph.Graph, edge_list: List[Tuple[str, str]], as_undirected: bool = True, normalization: bool = False) -> None 3. (self: libgraphvite.graph.Graph, weighted_edge_list: List[Tuple[str, str, float]], as_undirected: bool = True, normalization: bool = False) -> None Invoked with: 'edge_list.json'
gv.graph.Graph is a class. You need to create an instance first.
gv.graph.Graph
graph = gv.graph.Graph() graph.load(edge_list)
the edge_list is a list made of tuple but i can`t load the list as a graph
I also tried saving the list in a file and load it ,but it failed either with same typeerror.