Visualizing World Cup Data With Seaborn

The project link is

So when I finished this project, I checked the solution video and found that I hadn’t quite done it right. Step 6 says “You are going to create a bar chart visualizing how many goals were scored each year the World Cup was held between 1930-2014.” I took ‘how many goals were scored each year’ to indicate that they wanted a total of goals for each year. So I used

ax = sns.barplot(data = df, x = ‘Year’, y = ‘Total_Goals’, estimator = sum, ci=None)

I changed the estimator to sum to get the goal totals and got rid of the error bars since sums don’t create error. Apparently, the project actually wanted the averages to be graphed. I realize that average is the default estimator for the barplot function, but thought using a different estimator might be part of the challenge.

So just in case anyone else found that confusing or misleading, I thought I’d post about it.


I’m having a similar problem with this as when I save the results, the bar chart does not show up and I don’t know why.

Hi, can someone who got it be kind to explain the following lines:
f, ax = plt.subplots(figzise=(8,12))
ax = sns.boxplot(data = df, x= “colx” , y = "coly)

What is f in the context of this? And are we assigning the subplot to two variables at once? (is it a tuple or what? is f the figure?) and how can we assign both subplot and the boxplot to ax? I get that this is just how it’s done but I want to understand how it works. Thanks :slight_smile:

the f, ax part means figure-level function ax means axes-level functions

See documentation here:

I had this. I called the new column “Total Goals” and then in the plot I called it as “Total goals” (no capital G). There was no error, the plot just didn’t show up. It would have been useful to have an error telling me that it couldn’t find “Total goals”…