Repository for Petra's work at ampli Jan-Feb 2019

clustering.py 881B

1234567891011121314151617181920212223242526272829303132333435363738
  1. from util import getQuery, pickleQuery
  2. import pandas as p
  3. import matplotlib.pyplot as plt
  4. import seaborn as sns
  5. # query = """
  6. # SELECT *, read_date + CONCAT(period / 2, ':', period %% 2 * 30, ':00')::time AS read_time
  7. # FROM public.coup_tall_april WHERE icp_id LIKE (%s) AND read_date = to_date(%s, 'dd/mm/yyyy')
  8. # ORDER BY icp_id, read_time;
  9. # """
  10. #
  11. # qparams = ['%%1117', '20/04/2017']
  12. # query = """
  13. # SELECT read_date, period, AVG(kwh_tot) AS average
  14. # FROM public.coup_tall_april
  15. # GROUP BY read_date, period
  16. # ORDER BY read_date, period;
  17. # """
  18. #
  19. # qparams = []
  20. #
  21. # df = getQuery(query, qparams)
  22. #
  23. # print(df.info())
  24. #
  25. # sns.set()
  26. #
  27. # #sns.lineplot(x = 'read_time', y = 'kwh_tot', hue = 'icp_id', data = df)
  28. # sns.lineplot(x = 'period', y = 'average', hue = 'read_date', data = df)
  29. #
  30. # plt.show()
  31. df = p.read_pickle('../data/April.pkl')
  32. print(df)
  33. print(df.info())