Detect and merge by label

Once it's running
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
joshisanonymous
Posts:10
Joined:23 Feb 2017 21:34
[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
Detect and merge by label

Post by joshisanonymous » 24 Jun 2017 23:13

I have a very large directed graph which has many duplicate nodes. For some reason, one node was created for all incoming edges and another for all outgoing edges. For instance, I have a there might be two copies of the node "Jim", one with an indegree of 5 and outdegree of 0 and the other with an indegree of 0 and outdegree of 11. I have no idea why that happened, but I think at this point the easiest fix is to merge these duplicates and rerun the statistics.

The problem is that I cannot get Gephi to automatically detect the duplicates by the Label column. It works fine if I go by the degree column or something like that, but that's it. Is there something I'm missing here?

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Detect and merge by label

Post by eduramiba » 26 Jun 2017 09:36

What's the error or problem when using Label?
A workaround might be to duplicate the label column.

joshisanonymous
Posts:10
Joined:23 Feb 2017 21:34
[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: Detect and merge by label

Post by joshisanonymous » 01 Jul 2017 01:51

I choose detect and merge, choose the Label column, and then zero duplicates are found despite there being thousands.

I just attempted to duplicate the Label column as Label_copy and the result was the same: zero duplicates found in the Label_copy column.

joshisanonymous
Posts:10
Joined:23 Feb 2017 21:34
[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: Detect and merge by label

Post by joshisanonymous » 01 Jul 2017 02:01

Perhaps there's something I need to do with the source .csv files that I used to import the nodes and edges to avoid the problem of having duplicate nodes in the first place? My edges .csv file has a column labeled "source" and another labeled "target", with the values in each being names. My nodes .csv file has a single column labeled "id" with one copy of each of those names as values.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Detect and merge by label

Post by eduramiba » 01 Jul 2017 11:29

Your labels might not be actually equal. Make sure they use the same characters, and don't have trailing spaces.

Are you importing an edges spreadsheet? Can you show a screenshot of your data laboratory tables?

joshisanonymous
Posts:10
Joined:23 Feb 2017 21:34
[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: Detect and merge by label

Post by joshisanonymous » 01 Jul 2017 15:35

Ah, there is a trailing space only on the target column. That must be the problem. Thank you.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Detect and merge by label

Post by eduramiba » 01 Jul 2017 15:54

Great! For your info, this will be more user friendly in Gephi 0.9.2, where all values will be trimmed. You can try the latest snapshot (prebuild) at https://github.com/gephi/gephi#nightly-builds

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