title: how to create sum and inner sum of group by in pandas data frame
body: <p>I have the below data frame</p>
  <pre><code>       sector__description            industry__description     weight
             REAL ESTATE                      REAL ESTATE       0.564507
                INDUSTRIALS              INDUSTRIAL PRODUCTS    0.894072
                 TECHNOLOGY   TECH HARDWARE &amp; SEMICONDUCTORS    3.633277
            CLOSED END FUND                   FUND_OBJECTIVE    2.276752
                FINANCIALS               FINANCIAL SERVICES     1.145301
                    ENERGY                        OIL &amp; GAS     3.099118
                 TECHNOLOGY   TECH HARDWARE &amp; SEMICONDUCTORS    0.987115
                 FINANCIALS                          BANKING    6.034223
                HEALTH CARE                      HEALTH CARE    1.134993
                  UTILITIES                        UTILITIES    1.345726
               HEALTH CARE                      HEALTH CARE     1.117600
           CLOSED END FUND                  CLOSED END FUND     0.063387
               FINANCIALS                        INSURANCE      1.275847
          CONSUMER STAPLES         CONSUMER STAPLE PRODUCTS     0.634256
                FINANCIALS                        INSURANCE     15.541616
                FINANCIALS                        INSURANCE     4.777598
               REAL ESTATE                      REAL ESTATE     0.647987
              MONEY MARKET                     MONEY MARKET     2.634138
              MONEY MARKET                     MONEY MARKET     2.637100
               REAL ESTATE                      REAL ESTATE     0.788146
          CONSUMER STAPLES     RETAIL &amp; WHOLESALE - STAPLES     1.754561
                FINANCIALS                          BANKING     2.146774
    CONSUMER DISCRETIONARY  CONSUMER DISCRETIONARY SERVICES     3.579005
  </code></pre>
  <p>from this I need a list like below for all the sectors</p>
  <p>[ {'sector': 'FINANCIALS' , weight: 'total sum of all financials', sub:[{'sector': 'FINANCIAL SERVICES' , weight: 'total sum of all financial services'},{'sector': 'INSURANCE' , weight: 'total sum of all insurance'}, {'sector': 'BANKING' , weight: 'total sum of all banking']}, .....   ]</p>