Update script2.py

main
Nathan BOILEAU 3 years ago
parent d3d4e55350
commit df6bcefd3b

@ -21,7 +21,7 @@ try :
curs.execute('''DELETE FROM CO_DEUX WHERE code LIKE 'NaN' ''')
#Chart that picture the evolution of the emission in France
df3 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'FRA';''',con=co)
df3 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'FRA' AND year BETWEEN 1980 AND 2017;''',con=co)
#Chart that picture the evolution of the emission in France
print(df3)
@ -55,6 +55,30 @@ try :
plt.show()
df6 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'CHN' AND year BETWEEN 1980 AND 2017;''',con=co)
#Chart that picture the evolution of the emission in China
print(df6)
fig = df6.plot(x='year', y='emission', legend=False, kind='bar', style='-')
fig.set_title("Quantité d'émission (tonnes) en fonction des années")
fig.set_xlabel("annee")
fig.set_ylabel("emissions (en tonnes)")
plt.show()
df7 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'USA' AND year BETWEEN 1980 AND 2017;''',con=co)
#Chart that picture the evolution of the emission in China
print(df7)
fig = df7.plot(x='year', y='emission', legend=False, kind='bar', style='-')
fig.set_title("Quantité d'émission (tonnes) en fonction des années")
fig.set_xlabel("annee")
fig.set_ylabel("emissions (en tonnes)")
plt.show()
co.commit()

Loading…
Cancel
Save