pygraphistry
pygraphistry copied to clipboard
[FEA] List support in hypergraph entity extraction
Is your feature request related to a problem? Please describe.
When plotting some event data, some of the columns had entity lists ("topics", "attending_groups", ...) that it'd help to auto-link
Describe the solution you'd like
df = pd.DataFrame({'event': ['e1', 'e2'], 'attendees': [ ['a', 'b'], ['a', 'c', 'd'] ] })
graphistry.hypergraph(df)['graph'].plot()
Links: e1->a, e1->b, e2->a, e2->c, e2->d
The hypergraph code is a bit gnarly so may not be a good first issue, not sure
Describe alternatives you've considered
Current workaround uses explode:
graphistry.hypergraph(df.explode('attendess'), direct=True)['graph'].plot()
Additional context
Explode duplicates rows, so need to use direct=True with a manual event id col (like event above). Overall... janky!