igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] converting numpy adjacency matrices into igraph graph objec


From: Tamas Nepusz
Subject: Re: [igraph] converting numpy adjacency matrices into igraph graph objects
Date: Wed, 25 Nov 2009 15:55:19 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

Dear Ali,

> I've been using igraph with Python for some time. I have a  6500X6500
> adjacency matrix that I created using Python numpy. Its type is defined as
> "numpy.ndarray" in Python.
> Now I want to load it into igraph to create a graph object.
Assuming that your array is in a variable called "a", probably this is
the easiest way:

>>> from igraph import Graph
>>> g = Graph.Adjacency(a.tolist())

-- 
Tamas




reply via email to

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