Skip to content

Commit

Permalink
Merge pull request #101 from NREL/issue-51
Browse files Browse the repository at this point in the history
Addresses #51, weather normalizing recs data.
  • Loading branch information
joseph-robertson committed Oct 10, 2017
2 parents e56bf5d + 5ffc2cd commit 8ae6502
Show file tree
Hide file tree
Showing 30 changed files with 1,000 additions and 903 deletions.
3 changes: 1 addition & 2 deletions data/lmi/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def tract_to_tract_gisjoin(tract):
for col in df.columns:
if 'owner' in col or 'renter' in col:
df.loc[df['Dependency=Vintage'].isin(['<1950', '1950s', '1960s', '1970s', '1980s', '1990s']), col] *= 0.5

df['Dependency=Vintage'] = df['Dependency=Vintage'].map({'<1940': '<1950', '<1950': '<1950', '1950s': '1950s', '1960s': '1960s', '1970s': '1970s', '1980s': '1980s', '1990s': '1990s', '2000s': '2000s', '2010s': '2000s'})

df = df[np.concatenate([['Dependency=Vintage', 'Dependency=Heating Fuel', 'Dependency=Location EPW', 'Dependency=Location Census Tract', 'Dependency=Location County'], options])]
Expand Down Expand Up @@ -104,7 +104,6 @@ def add_option_prefix(df):
df = pd.read_sql(sql, con)
table_names = list(df['table_name'])
table_names = [x for x in table_names if not 'utility' in x]
table_names = ['tract_ct']

for i, table_name in enumerate(table_names):

Expand Down
595 changes: 214 additions & 381 deletions data/recs/output.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Dependency=Federal Poverty Level kwh_nrm Count Weight kwh_nrm_per_home kwh_nrm_total
0-50 3533168.81594 284 2826351.04745 12440.7352674 35161885154.1
50-100 4809236.81125 394 3944175.13325 12206.1848001 48143330560.6
100-150 6904038.98007 581 5788175.80286 11883.0275044 68781052265.8
150-200 8596409.1442 677 6091107.57095 12697.7978496 77343652616.2
200-250 8059709.8476 659 6224880.46165 12230.2122118 76131609039.3
250-300 11187830.891 900 8407236.68936 12430.9232122 1.04509713712e+11
300+ 59358922.0399 4308 38553776.4881 13778.7655617 5.31223447748e+11
Dependency=Federal Poverty Level kwhel_nrm Count Weight kwhel_nrm_per_home kwhel_nrm_total
100-150 6923124.25283 581 5788175.80286 11915.8765109 68971188090.3
150-200 8605672.78346 674 6074413.04189 12768.0605096 77558473279.1
250-300 11240336.0128 900 8407236.68936 12489.2622364 1.05000183697e+11
0-50 3535757.24957 283 2818399.52641 12493.8418713 35212638013.1
200-250 8055081.07078 656 6201840.53823 12279.0869981 76152939517.5
300+ 59512559.928 4294 38453553.1083 13859.4690098 5.3294582762e+11
50-100 4817113.69194 394 3944175.13325 12226.1768831 48222182837.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Dependency=Geometry House Size kwh_nrm Count Weight kwh_nrm_per_home kwh_nrm_total
0-1499 28355776.6706 2671 25054665.2481 10616.1649834 2.65984459876e+11
1500-2499 38897203.1067 2947 27186910.0344 13198.9152042 3.58837720207e+11
2500-3499 18336088.5111 1270 11488568.8532 14437.8649694 1.65870405794e+11
3500+ 16860248.2415 915 8105559.05801 18426.5008104 1.49357090551e+11
Dependency=Geometry House Size kwhel_nrm Count Weight kwhel_nrm_per_home kwhel_nrm_total
3500+ 17111008.3565 913 8095301.73995 18741.5206534 1.51718264755e+11
2500-3499 18414442.5488 1268 11473728.545 14522.4310322 1.66626431477e+11
1500-2499 38902990.7067 2942 27153438.9205 13223.3143123 3.59058457505e+11
0-1499 28261203.3774 2659 24965324.6348 10628.5082277 2.65344158287e+11
14 changes: 7 additions & 7 deletions data/recs/outputs/Electricity Consumption Heating Fuel.tsv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Dependency=Heating Fuel kwh_nrm Count Weight kwh_nrm_per_home kwh_nrm_total
Electricity 40757762.6026 2218 20000706.0601 18375.9073952 3.675311224e+11
Fuel Oil 5866059.4959 565 4677226.63479 10382.4061874 48560866753.0
Natural Gas 44970333.5287 4138 38479216.6155 10867.6494753 4.18178638261e+11
None 1742914.4197 181 1375948.07397 9629.36143478 13249501319.7
Other Fuel 3681267.29191 304 2869467.63026 12109.4318813 34747622804.2
Propane/LPG 5430979.19109 397 4433138.17897 13680.0483403 60645544587.5
Dependency=Heating Fuel kwhel_nrm Count Weight kwhel_nrm_per_home kwhel_nrm_total
None 1640831.62557 172 1315680.83335 9539.7187533 12551225119.2
Propane/LPG 5503450.05398 397 4433138.17897 13862.5945944 61454797356.0
Natural Gas 45336341.2153 4127 38395931.5416 10985.3019664 4.21790902265e+11
Electricity 40635665.0046 2218 20000706.0601 18320.858884 3.66430113307e+11
Other Fuel 3672103.09654 303 2865110.59149 12119.1521338 34722711138.4
Fuel Oil 5901253.99338 565 4677226.63479 10444.6973334 48852216560.1
Original file line number Diff line number Diff line change
@@ -1,84 +1,82 @@
Dependency=Location Region Dependency=Federal Poverty Level kwh_nrm Count Weight kwh_nrm_per_home kwh_nrm_total
CR01 0-50 11298.0656506 1 11795.05168 11298.0656506 133261268.233
CR01 50-100 3568.87456038 1 9007.728757 3568.87456038 32147454.0076
CR01 150-200 86252.0515826 3 34336.856964 28750.6838609 987208119.348
CR01 200-250 10556.8581477 1 7136.882777 10556.8581477 75343059.0937
CR01 250-300 14689.038687 1 13046.40491 14689.038687 191639146.449
CR01 300+ 249484.759672 20 174417.414229 12474.2379836 2175724333.57
CR02 0-50 136061.840563 14 89383.130156 9718.70289734 868688086.02
CR02 50-100 238677.022274 22 153438.439024 10848.9555579 1664646805.85
CR02 100-150 378702.520516 40 259554.663779 9467.5630129 2457350134.62
CR02 150-200 634774.325909 57 354243.426548 11136.3916826 3944993549.03
CR02 200-250 538406.506448 48 279103.303916 11216.8022177 3130646558.32
CR02 250-300 1089128.66354 99 644497.607567 11001.2996317 7090311292.77
CR02 300+ 5085057.7374 408 2540398.81228 12463.3768073 31661947638.4
CR03 0-50 117485.345838 8 42004.550465 14685.6682298 616864892.27
CR03 50-100 65046.014068 8 49810.802186 8130.7517585 404999267.466
CR03 100-150 126250.0 18 113734.891073 7013.88888889 797723888.776
CR03 150-200 350577.080891 46 265735.214586 7621.24088893 2025232083.03
CR03 200-250 183548.651817 24 131590.398066 7647.86049238 1006385006.55
CR03 250-300 410551.582649 47 297621.017114 8735.14005637 2599761268.21
CR03 300+ 3830329.13247 384 2188621.06278 9974.81544915 21831091189.4
CR04 0-50 406163.833529 31 476504.65642 13102.0591461 6243192191.8
CR04 50-100 481738.276671 46 670913.300309 10472.571232 7026187327.96
CR04 100-150 568702.227433 57 970235.272717 9977.23206022 9680262468.91
CR04 150-200 606213.071512 51 794217.56397 11886.530814 9440491547.12
CR04 200-250 583521.981243 60 957492.32415 9725.36635404 9311963633.54
CR04 250-300 775350.234467 77 1235428.87999 10069.4835645 12440130802.2
CR04 300+ 4324835.87339 344 5597949.80379 12572.1973064 70378529444.4
CR05 0-50 30408.8511137 3 84160.81407 10136.2837046 853077888.221
CR05 50-100 106426.729191 10 145586.152011 10642.6729191 1549425797.4
CR05 100-150 157254.982415 16 187248.433866 9828.43640094 1840359323.43
CR05 150-200 277744.431419 26 352061.643028 10682.4781315 3760890802.58
CR05 200-250 299225.087925 35 321089.319676 8549.28822643 2745085140.34
CR05 250-300 284248.241501 33 331332.081518 8613.58307578 2853956409.82
CR05 300+ 1970755.2755 180 1394305.48412 10948.6404194 15265749380.5
CR06 0-50 106542.203986 6 74989.726375 17757.0339977 1331595120.72
CR06 50-100 165979.19109 11 106080.704403 15089.0173718 1600653591.55
CR06 100-150 404472.157093 27 272233.19077 14980.4502627 4078175774.18
CR06 150-200 227319.75381 17 165743.209235 13371.7502241 2216276795.23
CR06 200-250 192172.039859 12 109692.566103 16014.3366549 1756653682.12
CR06 250-300 262623.974209 16 176083.940704 16413.998388 2890241518.88
CR06 300+ 2017942.55569 137 1424904.53863 14729.5077057 20988142381.7
CR07 0-50 223750.293083 23 244506.806721 9728.27361231 2378629115.86
CR07 50-100 139967.467761 18 190197.607696 7775.97043116 1478970973.52
CR07 100-150 302960.726846 36 391620.039414 8415.57574573 3295708105.24
CR07 150-200 453447.245018 54 630566.18926 8397.17120403 5294972246.69
CR07 200-250 470250.586166 52 654380.966605 9043.2805032 5917750636.97
CR07 250-300 689766.119578 65 853550.587414 10611.786455 9057696562.22
CR07 300+ 4358938.7456 406 4799086.22645 10736.3023291 51524440630.5
CR08 0-50 517701.641266 35 235423.716663 14791.4754647 3482264128.84
CR08 50-100 872609.906213 62 460809.8852 14074.353326 6485601140.43
CR08 100-150 1242912.95428 87 702388.648732 14286.3557963 10034574143.1
CR08 150-200 1872025.20516 139 896892.351636 13467.8072314 12079173299.1
CR08 200-250 1647410.60961 117 780063.489792 14080.4325608 10983631361.2
CR08 250-300 2445637.16295 171 1143533.79673 14301.9717132 16354788013.9
CR08 300+ 11117732.415 695 5011381.11664 15996.7372878 80165747171.8
CR09 0-50 1632774.03283 117 1187811.91906 13955.3336139 16576311601.0
CR09 50-100 2129693.43494 150 1626925.76777 14197.9562329 23099020845.0
CR09 100-150 2805380.42204 188 1973720.44477 14922.2362874 29452322842.3
CR09 150-200 3356024.32591 205 1975291.39484 16370.8503703 32337199862.6
CR09 200-250 3129761.72333 204 2078007.3904 15341.969232 31880725447.4
CR09 250-300 4232895.0762 268 2665127.52623 15794.3846127 42094049191.2
CR09 300+ 18907248.8277 1046 9816111.86095 18075.7636976 1.77433718428e+11
CR10 0-50 90135.1113716 7 88426.701131 12876.4444817 1138621507.81
CR10 50-100 183471.570926 14 156117.246982 13105.112209 2045934039.46
CR10 100-150 223853.165299 20 240658.382569 11192.6582649 2693607034.69
CR10 150-200 201900.644783 15 162469.298427 13460.0429855 2186843740.66
CR10 200-250 368522.567409 27 300697.217147 13648.9839781 4104211499.1
CR10 250-300 249220.98476 24 293187.185005 10384.2076983 3044516623.58
CR10 300+ 2226415.00586 136 1457215.29012 16370.6985725 23855632269.9
CR11 0-50 251391.559203 37 274159.669478 6794.36646494 1862741264.34
CR11 50-100 414456.330598 51 367335.979079 8126.59471761 2985190627.17
CR11 100-150 672672.919109 90 660878.79254 7474.14354566 4939502961.72
CR11 150-200 510491.793669 61 442855.8934 8368.71792901 3706136055.06
CR11 200-250 603659.43728 76 581772.04177 7942.88733263 4620949781.06
CR11 250-300 716261.723329 96 734109.510997 7461.05961801 5477234827.7
CR11 300+ 5079285.46307 533 3997101.86454 9529.61625342 38090846894.8
CR12 0-50 9456.03751465 2 17184.305234 4728.01875733 81247717.478
CR12 50-100 7601.992966 1 7951.519832 7601.992966 60447397.8319
CR12 100-150 20876.905041 2 15903.042628 10438.4525205 166003155.404
CR12 150-200 19639.2145369 3 16694.529058 6546.40484564 109289145.921
CR12 200-250 32673.7983587 3 23854.561252 10891.2661196 259806374.761
CR12 250-300 17458.0890973 3 19718.151179 5819.36303243 114747080.039
CR12 300+ 190896.248535 19 152283.013549 10047.1709755 1530013473.79
Dependency=Location Region Dependency=Federal Poverty Level kwhel_nrm Count Weight kwhel_nrm_per_home kwhel_nrm_total
CR01 150-200 85011.5641469 3 34336.856964 28337.188049 973009972.8
CR01 250-300 14577.0287287 1 13046.40491 14577.0287287 190177819.18
CR01 0-50 11104.0178958 1 11795.05168 11104.0178958 130972464.937
CR01 300+ 207145.890137 15 133933.197855 13809.7260091 1849580765.9
CR01 50-100 3524.06775678 1 9007.728757 3524.06775678 31743846.4743
CR02 100-150 385233.294848 40 259554.663779 9630.83237121 2499727458.02
CR02 150-200 642326.181845 57 354243.426548 11268.8803832 3991926800.32
CR02 250-300 1108035.68059 99 644497.607567 11192.279602 7213397426.68
CR02 0-50 137874.234866 14 89383.130156 9848.15963327 880259334.298
CR02 200-250 547931.779015 48 279103.303916 11415.2453962 3186032705.08
CR02 300+ 5199660.82338 407 2530399.00624 12775.5794186 32327313465.1
CR02 50-100 241158.697607 22 153438.439024 10961.7589822 1681955187.18
CR03 100-150 127128.355828 18 113734.891073 7062.68643486 803273872.352
CR03 150-200 351972.510454 46 265735.214586 7651.57631421 2033293273.78
CR03 250-300 412387.409076 47 297621.017114 8774.20019311 2611386385.84
CR03 0-50 117751.925519 8 42004.550465 14718.9906899 618264587.226
CR03 200-250 184574.555953 24 131590.398066 7690.60649804 1012009970.45
CR03 300+ 3859525.68765 384 2188621.06278 10050.8481449 21997497948.8
CR03 50-100 65178.5711167 8 49810.802186 8147.32138958 405824614.082
CR04 100-150 579490.398515 57 970235.272717 10166.4982196 9863895172.63
CR04 150-200 620154.739074 51 794217.56397 12159.8968446 9657603650.03
CR04 250-300 792027.481776 77 1235428.87999 10286.0711919 12707709412.1
CR04 0-50 408850.834035 31 476504.65642 13188.7365818 6284494393.52
CR04 200-250 596260.233415 60 957492.32415 9937.67055692 9515243278.18
CR04 300+ 4434451.31257 344 5597949.80379 12890.8468389 72162313532.4
CR04 50-100 489678.24512 46 670913.300309 10645.1792417 7141992337.45
CR05 100-150 158543.201246 16 187248.433866 9908.95007786 1855435383.34
CR05 150-200 278354.981467 26 352061.643028 10705.9608256 3769158158.47
CR05 250-300 287068.253279 33 331332.081518 8699.03797814 2882270360.5
CR05 0-50 30583.3134583 3 84160.81407 10194.4378194 857972185.87
CR05 200-250 303615.516392 35 321089.319676 8674.72903977 2785362845.75
CR05 300+ 1958474.12629 177 1379691.12728 11064.8255723 15266041667.0
CR05 50-100 106472.274106 10 145586.152011 10647.2274106 1550088868.29
CR06 100-150 400487.224527 27 272233.19077 14832.8601677 4037996851.69
CR06 150-200 224600.412374 17 165743.209235 13211.7889632 2189764302.49
CR06 250-300 259556.988596 16 176083.940704 16222.3117873 2856488586.83
CR06 0-50 105902.505899 6 74989.726375 17650.4176498 1323599989.96
CR06 200-250 189609.857094 12 109692.566103 15800.8214245 1733232648.59
CR06 300+ 1994778.46208 137 1424904.53863 14560.4267305 20747218132.6
CR06 50-100 163777.526252 11 106080.704403 14888.8660229 1579421395.47
CR07 100-150 305344.042199 36 391620.039414 8481.77894996 3321634606.68
CR07 150-200 451774.841424 54 630566.18926 8366.20076712 5275443336.31
CR07 250-300 696377.680918 65 853550.587414 10713.5027834 9144516594.0
CR07 0-50 226261.896204 23 244506.806721 9837.47374802 2405329292.33
CR07 200-250 474103.186121 52 654380.966605 9117.36896386 5966232715.47
CR07 300+ 4398309.89108 406 4799086.22645 10833.2755938 51989823689.5
CR07 50-100 140815.272166 18 190197.607696 7823.07067587 1487929327.39
CR08 100-150 1261429.02672 87 702388.648732 14499.1842152 10184062408.6
CR08 150-200 1911487.56739 139 896892.351636 13751.7091179 12333802729.8
CR08 250-300 2495885.69922 171 1143533.79673 14595.8228025 16690816665.6
CR08 0-50 530060.868072 35 235423.716663 15144.5962306 3565397131.97
CR08 200-250 1676556.49791 117 780063.489792 14329.5427172 11177953099.1
CR08 300+ 11382039.9805 695 5011381.11664 16377.0359431 82071568672.0
CR08 50-100 887189.848724 62 460809.8852 14309.5136891 6593965360.34
CR09 100-150 2795161.38052 188 1973720.44477 14867.8796836 29345038101.9
CR09 150-200 3335518.30927 205 1975291.39484 16270.8210208 32139612749.4
CR09 250-300 4201408.63661 268 2665127.52623 15676.8978978 41780932113.4
CR09 0-50 1626048.89602 117 1187811.91906 13897.8538122 16508036407.4
CR09 200-250 3101829.91462 204 2078007.3904 15205.0486011 31596203364.4
CR09 300+ 18712801.7664 1046 9816111.86095 17889.8678455 1.75608943949e+11
CR09 50-100 2117369.37718 150 1626925.76777 14115.7958478 22965351997.5
CR10 100-150 221758.408736 20 240658.382569 11087.9204368 2668400998.38
CR10 150-200 197009.897949 15 162469.298427 13133.9931966 2133870660.19
CR10 250-300 243963.230144 24 293187.185005 10165.1345893 2980287195.44
CR10 0-50 88538.1833414 7 88426.701131 12648.3119059 1118448496.72
CR10 200-250 361618.933326 27 300697.217147 13393.2938269 4027326182.18
CR10 300+ 2177465.70899 136 1457215.29012 16010.777272 23331149447.5
CR10 50-100 178329.390413 14 156117.246982 12737.8136009 1988592391.95
CR11 100-150 668054.141327 90 660878.79254 7422.82379252 4905586825.24
CR11 150-200 507461.778072 61 442855.8934 8319.04554216 3684138345.81
CR11 250-300 711730.254467 96 734109.510997 7413.85681737 5442582802.8
CR11 0-50 250352.574253 37 274159.669478 6766.28579062 1855042675.95
CR11 200-250 607242.59693 76 581772.04177 7990.03417013 4648378492.97
CR11 300+ 5047678.58661 531 3981695.01387 9505.98603881 37849937212.6
CR11 50-100 416306.899476 51 367335.979079 8162.88038188 2998519657.18
CR12 100-150 20494.7783729 2 15903.042628 10247.3891864 162964667.057
CR12 250-300 17317.6693685 3 19718.151179 5772.55645616 113824140.892
CR12 0-50 2428.0 1 9232.784198 2428.0 22417200.0327
CR12 200-250 11738.0 1 7951.520605 11738.0 93334948.8615
CR12 300+ 140227.692307 16 132564.863667 8764.23076919 1161829057.06
CR12 50-100 7313.52202575 1 7951.519832 7313.52202575 58153615.4295

0 comments on commit 8ae6502

Please sign in to comment.