Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created May 16, 2020 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/e4881609124470aa21df633acf4ed00b to your computer and use it in GitHub Desktop.
Save codecademydev/e4881609124470aa21df633acf4ed00b to your computer and use it in GitHub Desktop.
Codecademy export
import codecademylib3_seaborn
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sns
df = pd.read_csv('WorldCupMatches.csv')
df_goals = pd.read_csv('goals.csv')
df['Total Goals'] = df['Home Team Goals'] + df['Away Team Goals']
sns.set_style('whitegrid')
sns.set_context('notebook', font_scale = 1.25)
f, ax = plt.subplots(figsize = (12, 7))
ax = sns.barplot(x = df['Year'], y = df['Total Goals'])
ax.set_title("Fifa Total Goals")
plt.show()
f,ax2 = plt.subplot(figsize = (12,7))
print(df_goals.head())
ax2 = plt.plotbox(x = 'year' , y = 'goals' , color = 'Spectral')
ax2.set_title("Goals visulization")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment