[Python] Build aggregated network graph from Pandas dataframe containing a column with list of...

Discussão em 'Python' iniciado por Stack, Abril 3, 2025.

  1. Stack

    Stack Membro Participativo

    I'm dipping my toes into network visualizations in Python. I have a dataframe like the following:

    | user | nodes |
    | -----| ---------|
    | A | [0, 1, 3]|
    | B | [1, 2, 4]|
    | C | [0, 3] |
    |... | |


    Is there a way to easily plot a network graph (NetworkX?) from data that contains the list of nodes on each row? The presence of a node in a row would increase the prominence of that node on the graph (or the prominence/weight of the edge in the relationship between two nodes).

    [​IMG]

    I assume some transformation would be required to get the data into the appropriate format for NetworkX (or similar) to be able to create the graph relationships.

    Thanks!

    Continue reading...

Compartilhe esta Página