original_docstring: Take a plant-column data frame and sum to a location-column data frame.
  
      :param pandas.DataFrame df: dataframe, columns are plant id in grid.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*pandas.DataFrame*) -- index: df index, columns: location tuples.
      
docstring: Take a plant-column data frame and sum to a location-column data frame.
docstring_tokens: Take a plant - column data frame and sum to a location - column data frame .
code: def summarize_plant_to_location(df, grid):
      """Take a plant-column data frame and sum to a location-column data frame.
  
      :param pandas.DataFrame df: dataframe, columns are plant id in grid.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*pandas.DataFrame*) -- index: df index, columns: location tuples.
      """
      _check_data_frame(df, "PG")
      _check_grid_type(grid)
      _check_plants_are_in_grid(df.columns.to_list(), grid)
  
      all_locations = grid.plant[["lat", "lon"]]
      locations_in_df = all_locations.loc[df.columns].to_records(index=False)
      location_data = df.groupby(locations_in_df, axis=1).sum()
  
      return location_data
code_tokens: def summarize_plant_to_location ( df , grid ) : _check_data_frame ( df , "PG" ) _check_grid_type ( grid ) _check_plants_are_in_grid ( df . columns . to_list ( ) , grid ) all_locations = grid . plant [ [ "lat" , "lon" ] ] locations_in_df = all_locations . loc [ df . columns ] . to_records ( index = False ) location_data = df . groupby ( locations_in_df , axis = 1 ) . sum ( ) return location_data
short_docstring: Take a plant-column data frame and sum to a location-column data frame.
short_docstring_tokens: Take a plant - column data frame and sum to a location - column data frame .
comment: """Take a plant-column data frame and sum to a location-column data frame.
  
      :param pandas.DataFrame df: dataframe, columns are plant id in grid.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*pandas.DataFrame*) -- index: df index, columns: location tuples.
      """