IniziaInizia gratis

Creating a count plot

When creating quick analysis of frequency counts, you have been using .value_counts(). This is a great way for you to see the counts and get an idea of which categories are present in the data. However, sending frequency tables to clients or coworkers may not always be a good idea. For this exercise, you will visualize the number of reviews by their "Score". Although "Score" has been used as a numerical variable in the past, it can be used as a categorical variable given that it has five unique values that are ordered from worst to best. The reviews dataset has been preloaded.

Questo esercizio fa parte del corso

Working with Categorical Data in Python

Visualizza il corso

Istruzioni dell'esercizio

  • Use the catplot() function to display count frequencies using the reviews dataset.
  • Count the frequencies for the "Score" variable across the x-axis.
  • When counting the frequencies, color the bars using the "Traveler type" column.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

sns.set(font_scale=1.4)
sns.set_style("darkgrid")

# Create a catplot that will count the frequency of "Score" across "Traveler type"
sns.catplot(
  ____
)
plt.show()
Modifica ed esegui il codice