gephi-plugins icon indicating copy to clipboard operation
gephi-plugins copied to clipboard

Python: Cannot create new attributes on node

Open Rulasmur opened this issue 7 years ago • 3 comments

When I attempt: nde = g.addNode(label="Test",color=blue, size=5.0) nde.gender = "female" I get the error: Traceback (most recent call last): File "<input>", line 1, in <module> IllegalArgumentException: java.lang.IllegalArgumentException: The column 'gender' is not found

has the feature been removed or am I misunderstanding something?

Rulasmur avatar Nov 02 '17 10:11 Rulasmur

Mmm it's possible that you now need to add the column first, I will check it.

eduramiba avatar Nov 02 '17 10:11 eduramiba

Hey was this ever solved?

xander2508 avatar Aug 14 '20 14:08 xander2508

found that you can add a column like so:

>>> n = iter(g.nodes).next() # get any node
>>> n.newcolumn = "yay"
Traceback (most recent call last):
  File "<input>", line 1, in <module>
IllegalArgumentException: java.lang.IllegalArgumentException: The column 'newcolumn' is not found
>>> import java
>>> n.node.table.addColumn("newcolumn", java.lang.String)
newcolumn (class java.lang.String)
>>> n.newcolumn = "yay"
>>>

brad-alexander avatar Feb 11 '23 21:02 brad-alexander