kpi_csv_sq.py : sort by date

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-08-04 15:39:19 -06:00
parent 5d27932036
commit 199e85ff4f

View File

@@ -73,7 +73,9 @@ class csv_sqlite_dash():
#https://datacarpentry.org/python-ecology-lesson/09-working-with-sql/index.html-
self.conn = sqlite3.connect(self.database)
# df3 is just a name
df3 = pd.read_sql_query("SELECT * from {}".format(self.table) ,self.conn)
df3 = pd.read_sql_query("SELECT * from {}".format(self.table) ,self.conn) #current connection is sqlite3 /TODO move to SQLAlchemy
# sort by date column
df3 = df3.sort_values(by='Date')
#print(df3.head())
self.conn.close()