-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Practical Data Analysis
By :

Gephi is an excellent tool to get easy and fast results. However, if we want to present the graph interactively on a website, we need to implement a different kind of visualization. In order to work with the graph in the web, we need to transform our GDF file to JSON format.
Firstly, we need to import the libraries numpy
and json
. For more information about JSON format, refer to Chapter 2, Working with Data.
import numpy as np import json
The numpy
function, genfromtxt
, will obtain only the ID and name from the nodes.csv
file using the usecols
attribute in the 'object'
format.
nodes = np.genfromtxt("nodes.csv", dtype='object', delimiter=',', skip_header=1, usecols=(0,1))
Then, the numpy
function, genfromtxt
, will obtain links with the source node and target node from the links.csv
file using the usecols
attribute in the 'object'
format.
links = np.genfromtxt("links.csv", ...
Change the font size
Change margin width
Change background colour