Learn
Learn Seaborn Introduction
Plotting Aggregates

Recall our gradebook from the previous exercise:

student assignment_name grade
Amy Assignment 1 75
Amy Assignment 2 82
Bob Assignment 1 99
Bob Assignment 2 90
Chris Assignment 1 72
Chris Assignment 2 66

Suppose this data is stored in a Pandas DataFrame called df.

The same Seaborn command that you previously learned (sns.barplot()) will plot this data in a bar plot and automatically aggregate the data:

sns.barplot(data=df, x="student", y="grade")

In the example above, Seaborn will aggregate grades by student, and plot the average grade for each student.

Instructions

1.

Use Seaborn to plot the average grade for each assignment. Take a look at gradebook.csv for the column names.

2.

Use plt.show() to display the graph.

Folder Icon

Sign up to start coding

Already have an account?