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: Krishna Sandeep Reddy Dubba
Subject: Re: [igraph] reading gml files converts an int attribute into float
Date: Thu, 11 Jul 2013 21:11:47 +0100

Here is the python code that I tried:

import igraph
g = igraph.read('/usr/not-backed-up/31-0.gml')
print g.vs[0].attributes()

{'id': 0.0, 'label': 'labsv'}

Relevant part of 31-0.gml looks like this:

graph [
    directed 0
    node [
        id 0
        label "labsv"
   ]

Thanks,
dksr

On Thu, Jul 11, 2013 at 12:00 PM, 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

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





reply via email to

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