Ejemplo n.º 1
0
 def natural_gas_consumption_location_heating_region_geometry_house_size(
         self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)
     df = util.assign_size(df)
     df = util.assign_natural_gas_consumption(df)
     df = df.groupby([
         'Dependency=Location Heating Region',
         'Dependency=Geometry House Size'
     ])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['thm_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['thm_nrm_per_home'] = df['thm_nrm'] / df['Count']
     df['thm_nrm_total'] = df['thm_nrm_per_home'] * df['Weight']
     df = df.reset_index()
     df = df.sort_values(by=[
         'Dependency=Location Heating Region',
         'Dependency=Geometry House Size'
     ]).set_index([
         'Dependency=Location Heating Region',
         'Dependency=Geometry House Size'
     ])
     return df
Ejemplo n.º 2
0
 def natural_gas_consumption_location_heating_region_vintage(
         self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)
     df = util.assign_vintage(df)
     df = util.assign_natural_gas_consumption(df)
     df = df.groupby(
         ['Dependency=Location Heating Region', 'Dependency=Vintage'])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['thm_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['thm_nrm_per_home'] = df['thm_nrm'] / df['Count']
     df['thm_nrm_total'] = df['thm_nrm_per_home'] * df['Weight']
     df = df.reset_index()
     df['Dependency=Vintage'] = pd.Categorical(
         df['Dependency=Vintage'],
         ['<1950', '1950s', '1960s', '1970s', '1980s', '1990s', '2000s'])
     df = df.sort_values(
         by=['Dependency=Location Heating Region', 'Dependency=Vintage'
             ]).set_index([
                 'Dependency=Location Heating Region', 'Dependency=Vintage'
             ])
     return df
Ejemplo n.º 3
0
 def electricity_consumption_location_heating_region_geometry_foundation_type(
         self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)
     df = util.assign_vintage(df)
     df = util.assign_foundation_type(df)
     df = util.assign_electricity_consumption(df)
     df = df.groupby([
         'Dependency=Location Heating Region',
         'Dependency=Geometry Foundation Type'
     ])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['kwh_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['kwh_nrm_per_home'] = df['kwh_nrm'] / df['Count']
     df['kwh_nrm_total'] = df['kwh_nrm_per_home'] * df['Weight']
     df = df.reset_index()
     df = df.sort_values(by=[
         'Dependency=Location Heating Region',
         'Dependency=Geometry Foundation Type'
     ]).set_index([
         'Dependency=Location Heating Region',
         'Dependency=Geometry Foundation Type'
     ])
     return df
Ejemplo n.º 4
0
 def natural_gas_consumption_location_heating_region(self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)
     df = util.assign_natural_gas_consumption(df)
     df = df.groupby(['Dependency=Location Heating Region'])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['thm_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['thm_nrm_per_home'] = df['thm_nrm'] / df['Count']
     df['thm_nrm_total'] = df['thm_nrm_per_home'] * df['Weight']
     return df
Ejemplo n.º 5
0
 def natural_gas_consumption_location_heating_region(self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)
     df = util.assign_natural_gas_consumption(df)
     df = df.groupby(['Dependency=Location Heating Region'])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['thm_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['thm_nrm_per_home'] = df['thm_nrm'] / df['Count']
     df['thm_nrm_total'] = df['thm_nrm_per_home'] * df['Weight']
     return df
Ejemplo n.º 6
0
 def natural_gas_consumption_location_heating_region_geometry_house_size(self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)      
     df = util.assign_size(df)
     df = util.assign_natural_gas_consumption(df)
     df = df.groupby(['Dependency=Location Heating Region', 'Dependency=Geometry House Size'])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['thm_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['thm_nrm_per_home'] = df['thm_nrm'] / df['Count']
     df['thm_nrm_total'] = df['thm_nrm_per_home'] * df['Weight']
     df = df.reset_index()
     df = df.sort_values(by=['Dependency=Location Heating Region', 'Dependency=Geometry House Size']).set_index(['Dependency=Location Heating Region', 'Dependency=Geometry House Size'])
     return df
Ejemplo n.º 7
0
 def electricity_consumption_location_heating_region_heating_fuel(self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)
     df = util.assign_heating_fuel(df)
     df = util.assign_electricity_consumption(df)
     df = df.groupby(['Dependency=Location Heating Region', 'Dependency=Heating Fuel'])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['kwh_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['kwh_nrm_per_home'] = df['kwh_nrm'] / df['Count']
     df['kwh_nrm_total'] = df['kwh_nrm_per_home'] * df['Weight']
     df = df.reset_index()
     df = df.sort_values(by=['Dependency=Location Heating Region', 'Dependency=Heating Fuel']).set_index(['Dependency=Location Heating Region', 'Dependency=Heating Fuel'])             
     return df        
Ejemplo n.º 8
0
 def natural_gas_consumption_location_heating_region_vintage(self, screen_scen):
     df = util.create_dataframe(self.session, rdb, screen_scen=screen_scen)
     df = util.assign_climate_zones(df)
     df = util.assign_heating_location(df)        
     df = util.assign_vintage(df)
     df = util.assign_natural_gas_consumption(df)       
     df = df.groupby(['Dependency=Location Heating Region', 'Dependency=Vintage'])
     count = df.agg(['count']).ix[:, 0]
     weight = df.agg(['sum'])['Weight']
     df = df[['thm_nrm']].sum()
     df['Count'] = count
     df['Weight'] = weight
     df['thm_nrm_per_home'] = df['thm_nrm'] / df['Count']
     df['thm_nrm_total'] = df['thm_nrm_per_home'] * df['Weight']
     df = df.reset_index()
     df['Dependency=Vintage'] = pd.Categorical(df['Dependency=Vintage'], ['<1950', '1950s', '1960s', '1970s', '1980s', '1990s', '2000s'])
     df = df.sort_values(by=['Dependency=Location Heating Region', 'Dependency=Vintage']).set_index(['Dependency=Location Heating Region', 'Dependency=Vintage'])
     return df