networkcommons.utils.subset_df_with_nodes

networkcommons.utils.subset_df_with_nodes(network, dataframe)

Subsets a dataframe using the nodes of a network as the index.

Parameters: network (networkx.Graph): The network from which to extract nodes. dataframe (pd.DataFrame): The dataframe to subset.

Returns: pd.DataFrame: A subset of the dataframe with rows that have indices matching the nodes of the network.