MulaiMulai sekarang secara gratis

Visualize average quantity metric

You are now going to visualize average quantity values in a heatmap.

We have loaded pandas package as pd, and the average quantity values DataFrame as average_quantity.

Please use the console to explore it.

Latihan ini adalah bagian dari kursus

Customer Segmentation in Python

Lihat Kursus

Petunjuk latihan

  • Import seaborn package as sns.
  • Initialize an 8 by 6 inches figure.
  • Add a title.
  • Create the heatmap of the average quantity values with annotations and show the plot.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Import seaborn package as sns
import ____ as sns

# Initialize an 8 by 6 inches plot figure
plt.____(figsize=(____, ____))

# Add a title
plt.____('Average Spend by Monthly Cohorts')

# Create the heatmap
sns.____(____, annot=____, cmap='Blues')
plt.____()
Edit dan Jalankan Kode