<｜begin▁of▁sentence｜>### Instruction:
Given a graph representing a karate club network where each node is labeled as belonging to one of two clubs ('Mr. Hi' or 'Officer'), how can the graspologic's degreeplot function be used to visualize the degree distribution of the nodes categorized by their club membership?
### Response:
import networkx as nx
import matplotlib.pyplot as plt
from graspologic.plot import degreeplot
import numpy as np

# Construct a graph
G = nx.karate_club_graph()

# Map node to club 'Mr. Hi' or 'Officer'
club_labels = np.array([G.nodes[n]['club'] for n in G.nodes])

# Plot the degree distribution categorized by the 'club' attribute
fig, ax = plt.subplots()
ax = degreeplot(X=nx.to_numpy_array(G), labels=club_labels, title='Karate Club Degree Distribution')

# Show the plot
plt.show()
<|EOT|>
