1234567891011121314151617181920212223242526272829303132333435363738 |
- from util import getQuery, pickleQuery
- import pandas as p
- import matplotlib.pyplot as plt
- import seaborn as sns
-
-
- # query = """
- # SELECT *, read_date + CONCAT(period / 2, ':', period %% 2 * 30, ':00')::time AS read_time
- # FROM public.coup_tall_april WHERE icp_id LIKE (%s) AND read_date = to_date(%s, 'dd/mm/yyyy')
- # ORDER BY icp_id, read_time;
- # """
- #
- # qparams = ['%%1117', '20/04/2017']
-
- # query = """
- # SELECT read_date, period, AVG(kwh_tot) AS average
- # FROM public.coup_tall_april
- # GROUP BY read_date, period
- # ORDER BY read_date, period;
- # """
- #
- # qparams = []
- #
- # df = getQuery(query, qparams)
- #
- # print(df.info())
- #
- # sns.set()
- #
- # #sns.lineplot(x = 'read_time', y = 'kwh_tot', hue = 'icp_id', data = df)
- # sns.lineplot(x = 'period', y = 'average', hue = 'read_date', data = df)
- #
- # plt.show()
-
- df = p.read_pickle('../data/April.pkl')
-
- print(df)
- print(df.info())
|