Skip to content

Instantly share code, notes, and snippets.

@techwithshadab
Created November 3, 2021 20:56
Show Gist options
  • Save techwithshadab/3ec05c5013f774dc7935e4496dc4323d to your computer and use it in GitHub Desktop.
Save techwithshadab/3ec05c5013f774dc7935e4496dc4323d to your computer and use it in GitHub Desktop.
# Covariance Matrix
sigma = data.get_period_return_covariance_matrix()
f, ax = plt.subplots(figsize=(10, 8))
sns.heatmap(sigma, mask=np.zeros_like(sigma, dtype=np.bool), annot=True, square=True, ax=ax, xticklabels=stock_list, yticklabels=stock_list)
plt.title("Covariance between Equities")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment