|Home Wiki Blog Forum GEXF.net|
francis_flavin wrote:You could just write a quick program in Python or some other language to create a one-off routine that does what you need.
Or, if you're not a programmer, you could use a spreadsheet program (like Excel) and a database program (like Access) to do this. I'm not entirely sure how your data is structured, but maybe this would work (presuming at your NodeLabel.csv has the label for the nth node in the nth column and that your nodes are numbered 1-n):
1.) Import AdjacentMatrix.csv into Gephi.
2.) Export the resultant graph's edge table as a .CSV called nodes.csv and node table as a .CSV called edges.csv.
3.) Using a spreadsheet, turn your 2000-column row of labels in NodeLabel.csv into a 2000-row column of labels.
4.) Using a spreadsheet, auto-number the rows so that the auto-number corresponds to the node ID and save the resultant spreadsheet as a .CSV called Nodes_w_Labels.csv (the idea is to have a column for node ID from the adjacency matrix AND a label column that contains the each node's proper label value).
5.) Import your node.csv into a SQL table; import your Nodes_w_Labels.csv into an SQL table; then execute a join that joins the nodes from nodes.csv with the Nodes_with_Labels table, using the node id as the join field.
6.) Save your joined table as a .CSV called "nodes_new.csv".
7.) Open a new Gephi project.
8.) In the data laboratory, import a nodes_new.csv as a your node table, then import your edges.csv as your edge table.
I left out a little detail, but this should give you the general idea about how to use the Data Lab to import and export nodes and edges as needed.
Users browsing this forum: Bing [Bot] and 1 guest