<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def consumption(self):
 """ Consumption in kWh per sector for whole grid Returns ------- :pandas:`pandas.Series<series>` Indexed by demand sector """

        consumption = defaultdict(float)
        for load in self.graph.nodes_by_attribute('load'):
            for sector, val in load.consumption.items():
                consumption[sector] += val

        return pd.Series(consumption)