original_docstring: Take a plant-column data frame and decompose it into plant-column data frames
      for areas.
  
      :param pandas.DataFrame df: data frame, columns are plant id in grid.
      :param dict areas: areas to use for decomposition. Keys are area types
          ('*loadzone*', '*state*', or '*interconnect*'), values are
          str/list/tuple/set of areas.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*dict*) -- keys are areas, values are plant-column data frames.
      
docstring: Take a plant-column data frame and decompose it into plant-column data frames
  for areas.
docstring_tokens: Take a plant - column data frame and decompose it into plant - column data frames for areas .
code: def decompose_plant_data_frame_into_areas(df, areas, grid):
      """Take a plant-column data frame and decompose it into plant-column data frames
      for areas.
  
      :param pandas.DataFrame df: data frame, columns are plant id in grid.
      :param dict areas: areas to use for decomposition. Keys are area types
          ('*loadzone*', '*state*', or '*interconnect*'), values are
          str/list/tuple/set of areas.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*dict*) -- keys are areas, values are plant-column data frames.
      """
      _check_data_frame(df, "PG")
      plant_id = set(df.columns)
      _check_plants_are_in_grid(plant_id, grid)
      areas = _check_areas_are_in_grid_and_format(areas, grid)
  
      df_areas = {}
      for k, v in areas.items():
          if k == "interconnect":
              for i in v:
                  name = "%s interconnect" % " - ".join(i.split("_"))
                  df_areas[name] = df[get_plant_id_in_interconnects(i, grid) & plant_id]
          elif k == "state":
              for s in v:
                  df_areas[s] = df[get_plant_id_in_states(s, grid) & plant_id]
          elif k == "loadzone":
              for l in v:
                  df_areas[l] = df[get_plant_id_in_loadzones(l, grid) & plant_id]
  
      return df_areas
code_tokens: def decompose_plant_data_frame_into_areas ( df , areas , grid ) : _check_data_frame ( df , "PG" ) plant_id = set ( df . columns ) _check_plants_are_in_grid ( plant_id , grid ) areas = _check_areas_are_in_grid_and_format ( areas , grid ) df_areas = { } for k , v in areas . items ( ) : if k == "interconnect" : for i in v : name = "%s interconnect" % " - " . join ( i . split ( "_" ) ) df_areas [ name ] = df [ get_plant_id_in_interconnects ( i , grid ) & plant_id ] elif k == "state" : for s in v : df_areas [ s ] = df [ get_plant_id_in_states ( s , grid ) & plant_id ] elif k == "loadzone" : for l in v : df_areas [ l ] = df [ get_plant_id_in_loadzones ( l , grid ) & plant_id ] return df_areas
short_docstring: Take a plant-column data frame and decompose it into plant-column data frames
  for areas.
short_docstring_tokens: Take a plant - column data frame and decompose it into plant - column data frames for areas .
comment: """Take a plant-column data frame and decompose it into plant-column data frames
      for areas.
  
      :param pandas.DataFrame df: data frame, columns are plant id in grid.
      :param dict areas: areas to use for decomposition. Keys are area types
          ('*loadzone*', '*state*', or '*interconnect*'), values are
          str/list/tuple/set of areas.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*dict*) -- keys are areas, values are plant-column data frames.
      """