Heatmap

PHOTO EMBED

Tue Nov 19 2024 02:51:13 GMT+0000 (Coordinated Universal Time)

Saved by @login123

#7. Heatmap
#Heatmaps are used to visualize the correlation between different variables.
import seaborn as sns
import pandas as pd

# Example: Heatmap of correlations
data = {
    'Sales': sales,
    'Profit': profit,
    'Products Sold': products_sold
}
df = pd.DataFrame(data)
correlation_matrix = df.corr()

sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm')
plt.title("Correlation Heatmap")
plt.show()
content_copyCOPY