xgi icon indicating copy to clipboard operation
xgi copied to clipboard

add edge_size_histogram() function

Open maximelucas opened this issue 2 years ago • 2 comments

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.

maximelucas avatar Oct 03 '22 16:10 maximelucas

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.

leotrs avatar Oct 04 '22 05:10 leotrs

I think it would! As I mentioned in the related issue, just wondering about the call syntax with many dots.

maximelucas avatar Oct 27 '22 08:10 maximelucas

Closing this in favor of #117.

leotrs avatar Jun 19 '23 08:06 leotrs