original_docstring: 
      Total output contraction using simple quadrature
      Args:
          sol: solution matrix
          time_vec: arraylike time steps 
          sectors: list of sectors in our economy
      Returns:
          Total output loss as a vector if sectors is not None, where each entry corresponds to a sector, or a scalar otherwise
      
docstring: Total output contraction using simple quadrature
docstring_tokens: Total output contraction using simple quadrature
code: def total_out_loss(sol,time_vec, by_sector = True, sectors = None):
      '''
      Total output contraction using simple quadrature
      Args:
          sol: solution matrix
          time_vec: arraylike time steps 
          sectors: list of sectors in our economy
      Returns:
          Total output loss as a vector if sectors is not None, where each entry corresponds to a sector, or a scalar otherwise
      '''
      # num_sectors = sol.shape[1]
      if by_sector == True:
          _sol_df = pd.DataFrame(data = sol, columns = sectors)
          tot_out_loss = pd.Series(data = np.zeros(sol.shape[1]), index = sectors)
          for n in sectors:
              tot_out_loss.loc[n] = simps(_sol_df.loc[:,n],time_vec)
      else:
          num_sectors = sol.shape[1]
          tot_out_loss = 0
          for n in range(num_sectors):
              tot_out_loss += simps(sol[:,n],time_vec)
      
      return tot_out_loss
code_tokens: def total_out_loss ( sol , time_vec , by_sector = True , sectors = None ) : if by_sector == True : _sol_df = pd . DataFrame ( data = sol , columns = sectors ) tot_out_loss = pd . Series ( data = np . zeros ( sol . shape [ 1 ] ) , index = sectors ) for n in sectors : tot_out_loss . loc [ n ] = simps ( _sol_df . loc [ : , n ] , time_vec ) else : num_sectors = sol . shape [ 1 ] tot_out_loss = 0 for n in range ( num_sectors ) : tot_out_loss += simps ( sol [ : , n ] , time_vec ) return tot_out_loss
short_docstring: Total output contraction using simple quadrature
short_docstring_tokens: Total output contraction using simple quadrature
comment: '''
      Total output contraction using simple quadrature
      Args:
          sol: solution matrix
          time_vec: arraylike time steps 
          sectors: list of sectors in our economy
      Returns:
          Total output loss as a vector if sectors is not None, where each entry corresponds to a sector, or a scalar otherwise
      '''$SEP$# num_sectors = sol.shape[1]