pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

[FEA] List support in hypergraph entity extraction

Open lmeyerov opened this issue 3 years ago • 0 comments

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!

lmeyerov avatar Feb 03 '22 05:02 lmeyerov