[SOLVED] Using precalculated data in table nodes

Get help with your data
cthovex
Posts:10
Joined:05 Feb 2013 12:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[SOLVED] Using precalculated data in table nodes

Post by cthovex » 05 Feb 2013 15:23

Hi,

I import nodes and edges from csv files in gephi. Files are automatically generated from a database. Both the tables are coherent and correctly imported in Gephi (same number of nodes and edges than in the files). My table nodes comprises 3 columns with précalculated values (float, such as 1.025 for instance), which appear in the data laboratory as they are in the files.
everything seems to be cofrrect in the data as in the overview, but my 3 columns never appear in the list of value when I want to use it to set the color and the dimension of the nodes. I use Gephi to figure out the network based on the data precalculated with my software, it is painful not to be able to select the imported data in the classification panel ! Why ? Is there a turnaround ?
Thanks to you

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Using precalutaed data in table nodes

Post by admin » 05 Feb 2013 18:37

Hi,

Did you select the column type to be "float" instead of "strings"? In the case of strings, this behavior is normal.

cthovex
Posts:10
Joined:05 Feb 2013 12:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Using precalutaed data in table nodes

Post by cthovex » 05 Feb 2013 18:53

No, 2 columns were imported as float, data are formatted with point as decimal separator, and the last one was imported as Int, with int value in the data. The export is made from SQL Studio Manager and SQL server 2012 (CSV with separator ;), commas are replaced by dots in the CSV thanks to notepad++.

cthovex
Posts:10
Joined:05 Feb 2013 12:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Using precalutaed data in table nodes

Post by cthovex » 05 Feb 2013 21:24

I have retried, always with flot and int parameters and the issues is always the same : the columns don't appear in the "classification/ranking" list but they always appeer in the "partition" list.

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Using precalutaed data in table nodes

Post by seinecle » 06 Feb 2013 01:32

Hi,

Annoying indeed. I have to say with Seb that it looks like your attribute is recognized as non numerical. There is not much that can go wrong here... maybe you can share as an attachment a mock version of a few lines of your data, so that we see what is going on?

Best,

Clement

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Using precalutaed data in table nodes

Post by seinecle » 06 Feb 2013 10:03

Hi,

Ok I just had the same problem using Gephi 0.8.1 (an integer or float attribute which is stubbornly recognized as a string when importing as a spreadsheet in the datalab).

Moving to 0.8.2 (current version of Gephi, from the main page: www.gephi.org) solved the issue.

Best,

Clement

cthovex
Posts:10
Joined:05 Feb 2013 12:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Using precalutaed data in table nodes

Post by cthovex » 06 Feb 2013 11:00

It is the same with 0.8.1 and 0.8.2. with JRE 7.0.9 and 7.0.13.
I will try with a subset of data and post it.

cthovex
Posts:10
Joined:05 Feb 2013 12:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Using precalutaed data in table nodes

Post by cthovex » 06 Feb 2013 11:27

Here is a sample for importing nodes from csv (note : using Win 7 Pro 64 bits) :

IdGephi;idcourse;label;moyenne;somme;degre
1;13153;leg;0.729824905325455;740.042454000012;1014
2;5893;con;0.674809139130431;543.221356999997;805
3;23897;tuy;0.545016247787611;431.107852;791
4;12286;int;0.734677082089553;492.233645;670
5;15451;not;0.676103482539679;212.972596999999;315
6;23537;tra;0.842730386617102;226.694474;269
7;18086;pro;0.517306493827161;125.705478;243
8;4028807d16245e4d011625136b6e398a;402;0.648776125;20.760836;32
9;d37394c523f143490123f1ff41b31652;d37;0.648776125;20.760836;32
10;4028807d16245e4d01162514db0c4ea8;402;0.6174245;16.053037;26
11;d37394c523f143490123f201b3fb1fa1;d37;0.6174245;16.053037;26
12;d37394c530e1068301310a08c6e7078c;d37;0.651084846153846;16.928206;26
13;4028807d16245e4d01162517b3c27f4e;402;0.7414733;14.829466;20
14;d37394c523f143490123f20967743a61;d37;0.7414733;14.829466;20
15;d373944538ca4eab0138e178df4b1ced;d37;1.11145077777778;10.003057;9
16;d37394c524358e5301247b558da0773a;d37;1.06455633333333;6.387338;6
17;d37394c52fdba98c012fdf7775204f27;d37;1.410497;4.231491;3

...and here is the corresponding edges :
Source;Target;Type;label;Weight
6;12;Undirected;cf_r;2.90491
4;10;Undirected;cf_r;2.80782
4;11;Undirected;cf_r;2.80782
5;13;Undirected;cf_r;2.79395
5;14;Undirected;cf_r;2.79395
7;16;Undirected;cf_r;2.78147
3;8;Undirected;cf_r;2.78008
3;9;Undirected;cf_r;2.78008
1;15;Undirected;cf_r;2.76951
2;17;Undirected;cf_r;2.75755

I have noticed that :
After replacing commas with dots in both the original csv files (notepad ++), I need to open the csv file of edges with Excel 2007 and save it as CSV file (standard, not CSV for MAC or DOS). While this is not done, import is impossible in gephi which returns an error message before to import the file : "edge file needs Source and Target corresponding to nodes id in the table nodes".
Anyway, just with nodes imported (somme and moyenne are imported as float and degre as int), it is impossible to get the columns moyenne;somme;degre in the classification list, although they appear in the partition list ! I have tried with or without the option "force nodes to be created as new", with same results.

Please, could you try this dataset on your machines and say me if you reproduce the issue ?

Kind regards to you all,
Chris.

cthovex
Posts:10
Joined:05 Feb 2013 12:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Using precalutaed data in table nodes

Post by cthovex » 06 Feb 2013 11:57

N.B. My original CSV file format is recognized as Dos\Windows UTF8 in notepad++.

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Using precalutaed data in table nodes

Post by seinecle » 06 Feb 2013 12:10

Importing these two files works for me -> numerical node attributes appear in the ranking panel.

But careful, the first line of your nodes is incorrect: "idGephi" should be renamed as "id". Simply because the source and target columns for edges refer to an "id" column in nodes, if you don't have one, that's a problem.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable