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.
Diese Übung ist Teil des Kurses
Working with Categorical Data in Python
Anleitung zur Übung
- Use the
catplot()
function to display count frequencies using thereviews
dataset. - Count the frequencies for the
"Score"
variable across the x-axis. - When counting the frequencies, color the bars using the
"Traveler type"
column.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
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()