What is the best way to visualize the relationship two categorical variables
You can use a confusion matrix to generate the heat map of your data.

Suppose you have:

labels = ['cardiac arrest', 'choking', 'seizure']
dispatch_code = ['cardiac arrest', 'choking', 'seizure', 'choking', 'seizure', 'seizure', 'cardiac arrest', 'cardiac arrest']
hospital_code = ['cardiac arrest', 'choking', 'cardiac arrest', 'choking', 'seizure', 'seizure', 'seizure', 'cardiac arrest']


Then you can plot with:

from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt

cm = confusion_matrix(hospital_code, dispatch_code)
fig = plt.figure()
ax = fig.add_subplot(111)
cax = ax.matshow(cm)
plt.title('Confusion matrix of the classifier')
fig.colorbar(cax)
ax.set_xticklabels([''] + labels)
ax.set_yticklabels([''] + labels)
plt.xlabel('Predicted')
plt.ylabel('True')
plt.show()




This example shows that often there is a correct code coming from the dispatcher (yellow stripe in the middle). Cardiac arrest and seizure are often confused (blue) and chocking is never misclassified (purple).