Browse Source

Grab only first week of april; icp ids ending in 17

Petra Lamborn 5 years ago
parent
commit
f02eb5257b
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      py/downkwh.py

+ 3
- 2
py/downkwh.py View File

11
     FROM
11
     FROM
12
     (
12
     (
13
         SELECT read_time 
13
         SELECT read_time 
14
-        FROM GENERATE_SERIES('2017-04-01 00:30:00'::timestamp, '2017-05-01 00:00:00'::timestamp, 
14
+        FROM GENERATE_SERIES('2017-04-01 00:30:00'::timestamp, '2017-04-08 00:00:00'::timestamp, 
15
             '30 minutes'::interval) read_time
15
             '30 minutes'::interval) read_time
16
     ) AS tsdata CROSS JOIN
16
     ) AS tsdata CROSS JOIN
17
     (
17
     (
23
             WHERE read_date >= to_date('01/01/2017','dd/mm/yyyy')
23
             WHERE read_date >= to_date('01/01/2017','dd/mm/yyyy')
24
                 AND read_date <  to_date('01/01/2018','dd/mm/yyyy')
24
                 AND read_date <  to_date('01/01/2018','dd/mm/yyyy')
25
                 AND content_code = 'UN'
25
                 AND content_code = 'UN'
26
+                AND icp_id LIKE '%%17'
26
             GROUP BY icp_id
27
             GROUP BY icp_id
27
         ) AS cir 
28
         ) AS cir 
28
         WHERE data_days >= 360
29
         WHERE data_days >= 360
36
 ON comb.read_time = tall_timestamp.read_time AND comb.icp_id = tall_timestamp.icp_id;
37
 ON comb.read_time = tall_timestamp.read_time AND comb.icp_id = tall_timestamp.icp_id;
37
 """
38
 """
38
 
39
 
39
-pickleQuery(query, "../data/April.pkl")
40
+pickleQuery(query, "../data/Aprilw1.pkl")