pyunicorn (Unified Complex Network and RecurreNce analysis toolbox) is a fully object-oriented Python package for the advanced analysis and modeling of complex networks. Above the standard measures of complex network theory such as degree, betweenness and clustering coefficient it provides some uncommon but interesting statistics like Newman’s random walk betweenness. pyunicorn features novel node-weighted (node splitting invariant) network statistics as well as measures designed for analyzing networks of interacting/interdependent networks.

Moreover, pyunicorn allows to easily construct networks from uni- and multivariate time series and event data (functional (climate) networks and recurrence networks). This involves linear and nonlinear measures of time series analysis for constructing functional networks from multivariate data (e.g. Pearson correlation, mutual information, event synchronization and event coincidence analysis). pyunicorn also features modern techniques of nonlinear analysis of single and pairs of time series such as recurrence quantification analysis (RQA), recurrence network analysis and visibility graphs.

For example, to generate a recurrence network with 1000 nodes from a sinusoidal signal and compute its network transitivity you simply need to type

import numpy as np
from pyunicorn.timeseries import RecurrenceNetwork

x = np.sin(np.linspace(0, 10 * np.pi, 1000))
net = RecurrenceNetwork(x, recurrence_rate=0.05)

The package provides special tools to analyze and model spatially embedded complex networks.

pyunicorn is fast because all costly computations are performed in compiled C, C++ and Fortran code. It can handle large networks through the use of sparse data structures. The package can be used interactively, from any Python script and even for parallel computations on large cluster architectures.