xgi
xgi copied to clipboard
add edge_size_histogram() function
Right now xgi.unique_edge_sizes(H) returns the existing the unique edge sizes in the hypergraph, but does not count them.
It would be nice to have an easy way to compute a histogram of edge sizes: how many edges have each given size.
@leotrs mentioned we can use something like
H.edges.size.aspandas().groupby().agg("count")
but a shorter way might be nice.
My solution to this was proposed here. Would something like this solve your issue? The shorter way after implementing that would be something like H.edges.size.asdist(), plus some bells and whistles for customization of the output.
I think it would! As I mentioned in the related issue, just wondering about the call syntax with many dots.
Closing this in favor of #117.