Menu

Correlation Heatmap

Correlation Heatmap

Heatmaps provide a visual representation of correlations among numerical variables.

Code

correlation = df.corr(

numeric_only=True

)

plt.figure(figsize=(8,6))

sns.heatmap(

correlation,

annot=True,

cmap='coolwarm'

)

plt.title("Correlation Heatmap")

plt.show()

Explanation

The heatmap uses colors to represent correlation strength.

Interpretation

Correlation Value

Meaning

+1Strong positive relationship
0No relationship
-1Strong negative relationship

Insight

The heatmap helps identify which weather variables influence each other.