igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] reading gml files converts an int attribute into float


From: Gábor Csárdi
Subject: Re: [igraph] reading gml files converts an int attribute into float
Date: Thu, 11 Jul 2013 13:27:27 -0400

Hi,

On Thu, Jul 11, 2013 at 7:00 AM, Krishna Sandeep Reddy Dubba <address@hidden> wrote:
Hi all,
I generate a gml file with nodes having an integer attribute. But when I read it back using igraph.read, the attribute values are floats.

for example this is how I generating gml file:

count = 0  # My intention is to make the attribute value an integer, otherwise I can use 0.0
for loop:
    node_attribute = count
    count += 1

Which language is this? It is actually helpful to send a reproducible example, because then at least we know if you are using C, R or Python. 

If this is R, then note that it R 0 is not an integer, it is a double. 0L is an integer:

is.integer(0)
# [1] FALSE
is.integer(0L)
# [1] TRUE

However, R igraph does not support integer attributes, only doubles. 

Best,
Gabor
 

But when I read the gml file using igraph, the node attribute becomes float, i.e. 0.0

Is it a bug or am I doing some silly mistake?

Cheers,
dksr




_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]