Skip to content

Instantly share code, notes, and snippets.

@Cvar1984
Created February 18, 2026 08:21
Show Gist options
  • Select an option

  • Save Cvar1984/01f224e2b1df08a594edd0442fed023e to your computer and use it in GitHub Desktop.

Select an option

Save Cvar1984/01f224e2b1df08a594edd0442fed023e to your computer and use it in GitHub Desktop.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
df = pd.read_csv("~/Downloads/ev_vs_petrol_dataset_v3.csv")
numeric_df = df.select_dtypes(include = ["number"])
corr_matrix = numeric_df.corr(method="pearson")
plt.figure(figsize=(14, 12))
sns.heatmap(corr_matrix, annot=True, fmt=".2f")
plt.title("Correlation Matrix Heatmap")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment