I'd like to use the "add_edge_list" function to add edges to my graph, and
simultaneously assign a value for an edge property map for each of the added
edges.
When I try the following example (with no edge property map information)
works fine:
elist1 = np.array([[0,1], [1, 2]]) #edge list with no value for edge
property map data (only the source and target for the edges)
g = gt.Graph()
my_eprop = g.new_edge_property('bool')
g.add_edge_list(elist)
But with the following example, I get the error below:
elist2 = np.array([[0,1, 1], [1, 2, 0]]) #edge list with edge property map
value in 3rd column
g = gt.Graph()
my_eprop = g.new_edge_property('bool')
g.add_edge_list(elist2, eprops=my_eprop)
How to add multiple edge properties?
If my_eprop and other_eprop are two arrays of edge properties and there is
another column of values in elist2, then
If you want us to understand the problem you are having, you must provide a
minimal and self-contained example that shows it, otherwise there is little
we can do.
I have a data frame where I have five columns. First two columns are the
source and sink nodes of interaction while the other three columns are three
kinds of edge properties.
Its' working when I changed the edge property type 'int' to 'float' for the
last one.
I can't reproduce this. The example you gave works as expected, regardless
of the property type.
Note that so far you have not produced a minimal example that even allegedly
reproduces the problem you are encountering. For some reason you gave us an
example that _works_ instead of one that doesn't. Could you please provide a
complete and minimal example that _shows_ the problem, i.e. gives the wrong
output?
Also, the assigned property values are reversed in order when I tried the
same for another example with only two property maps.
I can't reproduce this either. And as already explained many times, it is
useless to mention problems without a reproducible example.
So for now, the problem seems to have solved.
???
If the problems you mention are really there, then they need to be fixed. I
ask of you to please produce a minimal and complete example for them.