BaşlayınÜcretsiz Başlayın

One visualization per group

While working on a data exploration project, you have been asked to visualize the number of reviews of hotels by "Period of stay" and by the day of the week, "Review weekday". The goal of this visualization is to see what day of the week has the most reviews for each of the four periods of stay. The reviews dataset has been preloaded for you, as well as both seaborn, as sns, and matplotlib.pyplot as plt.

Bu egzersiz

Working with Categorical Data in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a catplot() using "count" as the type of graphic.
  • Count the number of reviews by "Review weekday".
  • Create individual plots for each "Period of stay".
  • Wrap the plots after every 2nd graphic.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a catplot for each "Period of stay" broken down by "Review weekday"
ax = sns.catplot(
  # Make sure Review weekday is along the x-axis
  ____,
  # Specify Period of stay as the column to create individual graphics for
  ____,
  # Specify that a count plot should be created
  ____,
  # Wrap the plots after every 2nd graphic.
  ____,
  data=reviews
)
plt.show()
Kodu Düzenle ve Çalıştır