Skip to content

network.utils

construct_attributes_dict(df, labels, id_column)

Section titled “construct_attributes_dict(df, labels, id_column)”

Function to construct a dictionary of nodes’ attributes from a DataFrame.

df : Pandas DataFrame containing nodes’ attributes.

labels : List of labels to add as nodes’ attributes.

id_column : Name of the column containing the subject’s ID tag.

attributes_dict : Dictionary of nodes’ attributes.

extract_subject_percentile(mat, percentile)

Section titled “extract_subject_percentile(mat, percentile)”

Function to extract subjects that are above the Xth percentile.

mat : Fuzzy C-partitioned membership matrix.

percentile : Percentile value.

label_dict : Dictionary of binary arrays for each clusters.

Function to generate a dataframe containing edges’ data.

df : Pandas DataFrame containing edges data and ids (membership matrix from clustering results).

DataFrame : Pandas DataFrame of starting node, target node and edge weights.