I am trying to write a function that takes a graph and return a DataFrame with the 1st column being the list of the node with the highest centrality measure and the 2nd column being the value of the highest centrality measure.
Attached below is my code and I could not figure out how to complete it. How can I find the highest centrality without having another function?
def summary(G):
df = pd.DataFrame()
dc=nx.degree_centrality(G)
cc=nx.closeness_centrality(G)
bc=nx.closeness_centrality(G)
df['Nodes with the highest centrality measure']= #addcodehere
df['Value of the highest centrality measure']= #addcodehere
return df.set_index(['dc','cc','bc'])