Prompt:

"Write Python code to generate a heatmap of correlation coefficients with color-coded annotations."

Output:

import seaborn as sns import matplotlib.pyplot as plt

Example dataset

df = sns.load_dataset('iris').drop(columns=['species'])

Correlation heatmap

plt.figure(figsize=(8, 6)) sns.heatmap(df.corr(), annot=True, cmap='coolwarm', fmt='.2f') plt.title('Correlation Heatmap') plt.show()