Skip to content

Instantly share code, notes, and snippets.

@gbarreiro
Created January 31, 2021 13:43
# Create a cross table and normalize it
home_host_countries = pd.crosstab(records['COUNTRYCODEOFHOMEINSTITUTION'], records['COUNTRYCODEOFHOSTINSTITUTION'], normalize='index')
# Plot home vs. destination country
f, ax = plt.subplots(figsize=(14, 12))
sns.heatmap(home_host_countries, ax=ax, linewidths=.5, cmap='Paired')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment