nws_tools.density_und

nws_tools.density_und(CIJ)[source]

Compute the connection density of an undirected graph

Parameters:

CIJ : NumPy 2darray

Undirected binary/weighted connection matrix

Returns:

den : float

density (fraction of present connections to possible connections)

See also

density_und.m
in the Brain Connectivity Toolbox (BCT) for MATLAB, currently available here
bctpy
An unofficial Python port of the BCT is currently available at the Python Package Index and can be installed using pip.

Notes

This function does not do any error checking and assumes you know what you are doing