I am writing on jupyter a program for the statistical validation of a network, the final product is a large pandas dataframe 5053x5053:
import pandas as pd
network = pd.DataFrame (data = app, index = products, columns = products)
app is a binary matrix where if app[i,j] = 1 the product i is linked to the product j. I would like to plot the network, and I just learned that it is possible using networkx (and sometimes other tools like cytoscape). Since the amount of data is large I have no clue on how to procede. Which kind of representation is the best and how can I obtain a readable plot? I have tried to write down some basic code, but results are quite disappointing:
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G = nx.from_pandas_edgelist(network)
nx.draw_random(G)
Furthermore I have a vector of 212 green products serial numbers (indexes and columns of the dataframe) that if possible I would like to draw of a different color on the same plot.
Edit: I used the code and it works better than my try, but it is still not a readble graph.
G = nx.from_numpy_matrix(gg)
G = nx.relabel_nodes(graph, dict(enumerate(greenxgreen.columns)))
nx.draw(G)


