Indexes only work if NetworkX ids are integers
See original GitHub issue_create_node
and _create_edge
accept only integers as ids (nx_id
, from_id
, to_id
). The ids could be, e.g., strings. Graphviz Python libraries create node ids that are integers. If ids are not integers it’s impossible to generate valid Memgraph queries.
Take a look here (How to analyze Python, Cpp and Rust dependencies? PART 2) to see the details about the problem. The solution was to use gqlalchemy
as a library and reuse some of the functions, but it’s definitely possible to push all the required capabilities into gqlalchemy
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
TypeError: string indices must be integers, not str
The rest of my code rearranges the order the atoms/nodes in my networkx graph.I want to convert the output i get from my...
Read more >relabel_nodes — NetworkX 2.8.8 documentation
Only the nodes specified in the mapping will be relabeled. Any non-node keys in the mapping are ignored. The keyword setting copy=False modifies...
Read more >NetworkX Reference
If the topology of the network is all you care about then using integers or strings as the nodes makes sense and you...
Read more >convert_node_labels_to_integers — NetworkX 2.8.8 ...
Returns a copy of the graph G with the nodes relabeled using consecutive integers. Parameters: Ggraph. A NetworkX graph. first_labelint, optional (default=0).
Read more >Tutorial — NetworkX 2.8.8 documentation
This guide can help you start working with NetworkX. Creating a graph#. Create an empty graph with no nodes and no edges. >>>...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see two ways to tackle this.
What do you think, is there a better way for approaching this?
Here is a minimal example,
example.py
produces queries that can’t be imported. Please rename the example files because.py
and.dot
can’t be directly uploaded here 😄example_dot.txt example_py.txt requirements.txt