I am referring to the well-known Zachary's Karate Club Network.

In Python, one can do the following:

import networkx as nx

pygr = nx.karate_club_graph()
pygr.number_of_nodes(), pygr.number_of_edges()
# (34, 78)

club_labels = nx.get_node_attributes(pygr, "club")
# {0: "Mr. Hi", ..., 9: "Officer", ...}

So, in Wolfram Language, I do the following:

wlgr = ResourceData["Zachary's Karate Club Network", All]["FullGraph"];
wlgr // {VertexCount, EdgeCount} // Through
(* 34, 78 *)

So far, so good. But the nodes in wlgr do not appear to have attributes. AnnotationKeys does not suggest any such key.

Is this an omission in ResourceData, or are the node attributes available in a different way?

  • 1
    $\begingroup$ "In Python, one can do the following" That is not "Python", but the NetworkX library, which happens to have this data built in. NetworkX is not part of the Python standard library, and is by far not the only library for manipulating graphs in Python. $\endgroup$
    – Szabolcs
    Commented Sep 17, 2022 at 7:37
  • $\begingroup$ It seems to me that this question is not about Mathematica, but about how to obtain a dataset. I would consider this off-topic here. $\endgroup$
    – Szabolcs
    Commented Sep 17, 2022 at 7:38

1 Answer 1


Zachary's Karate Club Network does not have vertex labels standardly:


If a graph has vertex labels


then you get them like



Although sometimes those labels are vertices themselves:




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.