diff options
| author | Priyansh <[email protected]> | 2021-12-09 01:40:24 -0500 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2021-12-09 01:40:24 -0500 |
| commit | 15b1a734b0b44bebe64df8f0bd514ac68dabb967 (patch) | |
| tree | f00f5dee8ed46aecb678f3a3eea7a4b5b4e2a26e /sql_functions.py | |
| parent | 42d30d98fc88f81ff58bf66c1a6eec372cb2649c (diff) | |
| download | temp_pred_arima-15b1a734b0b44bebe64df8f0bd514ac68dabb967.tar.xz temp_pred_arima-15b1a734b0b44bebe64df8f0bd514ac68dabb967.zip | |
Refactor code and time_series_model.py now builds a pickle file
Diffstat (limited to 'sql_functions.py')
| -rw-r--r-- | sql_functions.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql_functions.py b/sql_functions.py index 313c449..54d1d05 100644 --- a/sql_functions.py +++ b/sql_functions.py @@ -1,6 +1,7 @@ import sqlite3 as sql import pandas as pd + def execute_sql_statement(sql_statement): conn = sql.connect("database.db") cur = conn.cursor() @@ -8,11 +9,13 @@ def execute_sql_statement(sql_statement): rows = cur.fetchall() return rows + def run_sql_pandas(sql_statement): conn = sql.connect("database.db") - df=pd.read_sql_query(sql_statement, conn).to_records(index=False) + df = pd.read_sql_query(sql_statement, conn).to_records(index=False) return df + def get_list_of_dict(keys, list_of_tuples): - list_of_dict = [dict(zip(keys, values)) for values in list_of_tuples] - return list_of_dict
\ No newline at end of file + list_of_dict = [dict(zip(keys, values)) for values in list_of_tuples] + return list_of_dict |
