gephi / gephi-plugins

Repository for Gephi Plugins maintained by the team. Each plugin has it's branch.
270 stars 620 forks source link

Python: Cannot create new attributes on node #172

Open Rulasmur opened 6 years ago

Rulasmur commented 6 years ago

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?

eduramiba commented 6 years ago

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

xander2508 commented 4 years ago

Hey was this ever solved?

brad-alexander commented 1 year ago

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"
>>>