IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Working with Categorical Data in Python

Visualizza il corso

Istruzioni dell'esercizio

  • 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.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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()
Modifica ed esegui il codice