From 3b61a9af5d6bb09e6b5d139c77abbc3658d83e13 Mon Sep 17 00:00:00 2001 From: jebesson2 Date: Sat, 14 May 2022 06:48:07 +0000 Subject: [PATCH] Update script2.py --- script2.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/script2.py b/script2.py index b91b844..199437c 100644 --- a/script2.py +++ b/script2.py @@ -20,20 +20,28 @@ try : curs.execute('''DELETE FROM CO_DEUX WHERE emission = 0''') curs.execute('''DELETE FROM CO_DEUX WHERE code LIKE 'NaN' ''') - df3 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'FRA' AND year BETWEEN 2000 AND 2017;''',con=co) + df3 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'FRA';''',con=co) + #df4 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'CHN';''',con=co) + #df5 = pd.read_sql('''SELECT * FROM CO_DEUX WHERE code LIKE 'USA';''',con=co) #Chart that picture the evolution of the emission in France + print("test") print(df3) fig = df3.plot(x='year', y='emission', legend=False, style='-') + print("test") fig.set_title("Quantité d'émission (tonnes) en fonction des années") + print("test") fig.set_xlabel("annee") fig.set_ylabel("emissions (en tonnes)") - fig.set_xticks(df3.index) - fig.set_xticklabels(df3['year'], rotation='45') + + plt.show() + + + co.commit()