Utilities
Helpers for NetworkX.
These are not imported into the base networkx namespace but
can be accessed, for example, as
>>> import networkx
>>> networkx.utils.is_string_like('spam')
True
Helper functions
is_string_like(obj) |
Check if obj is string. |
flatten(obj[, result]) |
Return flattened version of (possibly nested) iterable object. |
iterable(obj) |
Return True if obj is iterable with a well-defined len() |
is_list_of_ints(intlist) |
Return True if list is a list of ints. |
_get_fh(path[, mode]) |
Return a file handle for given path. |
Data structures and Algorithms
UnionFind.union(*objects) |
Find the sets containing the objects and merge them all. |
Random sequence generators
pareto_sequence(n[, exponent]) |
Return sample sequence of length n from a Pareto distribution. |
powerlaw_sequence(n[, exponent]) |
Return sample sequence of length n from a power law distribution. |
uniform_sequence(n) |
Return sample sequence of length n from a uniform distribution. |
cumulative_distribution(distribution) |
Return normalized cumulative distribution from discrete distribution. |
discrete_sequence(n[, distribution, ...]) |
Return sample sequence of length n from a given discrete distribution or discrete cumulative distribution. |
SciPy random sequence generators