original_docstring: Take a plant-column data frame and sum to a bus-column data frame.
  
      :param pandas.DataFrame df: dataframe, columns are plant id in grid.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :param boolean all_buses: return all buses in grid, not just plant buses.
      :return: (*pandas.DataFrame*) -- index as df input, columns are buses.
      
docstring: Take a plant-column data frame and sum to a bus-column data frame.
docstring_tokens: Take a plant - column data frame and sum to a bus - column data frame .
code: def summarize_plant_to_bus(df, grid, all_buses=False):
      """Take a plant-column data frame and sum to a bus-column data frame.
  
      :param pandas.DataFrame df: dataframe, columns are plant id in grid.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :param boolean all_buses: return all buses in grid, not just plant buses.
      :return: (*pandas.DataFrame*) -- index as df input, columns are buses.
      """
      _check_data_frame(df, "PG")
      _check_grid_type(grid)
      _check_plants_are_in_grid(df.columns.to_list(), grid)
  
      all_buses_in_grid = grid.plant["bus_id"]
      buses_in_df = all_buses_in_grid.loc[df.columns]
      bus_data = df.T.groupby(buses_in_df).sum().T
      if all_buses:
          bus_data = pd.DataFrame(
              bus_data, columns=grid.bus.index, index=df.index
          ).fillna(0.0)
  
      return bus_data
code_tokens: def summarize_plant_to_bus ( df , grid , all_buses = False ) : _check_data_frame ( df , "PG" ) _check_grid_type ( grid ) _check_plants_are_in_grid ( df . columns . to_list ( ) , grid ) all_buses_in_grid = grid . plant [ "bus_id" ] buses_in_df = all_buses_in_grid . loc [ df . columns ] bus_data = df . T . groupby ( buses_in_df ) . sum ( ) . T if all_buses : bus_data = pd . DataFrame ( bus_data , columns = grid . bus . index , index = df . index ) . fillna ( 0.0 ) return bus_data
short_docstring: Take a plant-column data frame and sum to a bus-column data frame.
short_docstring_tokens: Take a plant - column data frame and sum to a bus - column data frame .
comment: """Take a plant-column data frame and sum to a bus-column data frame.
  
      :param pandas.DataFrame df: dataframe, columns are plant id in grid.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :param boolean all_buses: return all buses in grid, not just plant buses.
      :return: (*pandas.DataFrame*) -- index as df input, columns are buses.
      """