nichesphere.niche_stats.community_edge_stats_df

nichesphere.niche_stats.community_edge_stats_df#

nichesphere.niche_stats.community_edge_stats_df(g: Graph, partition: dict) → DataFrame#

Flat DataFrame version of community_edge_stats().

Returns one row per community with the count and weight columns. The nested external_by_community breakdown is omitted (call community_edge_stats() directly if you need it).

Parameters:
  • g (nx.Graph) – Signed co-localization network.

  • partition (dict) – Mapping of node → community name.

Returns:

df – Indexed by community name, sorted alphabetically.

Return type:

pd.DataFrame