code: def import_series_from_dataframe(network, dataframe, cls_name, attr):
      
  
      df = network.df(cls_name)
      pnl = network.pnl(cls_name)
      list_name = network.components[cls_name]["list_name"]
  
      diff = dataframe.columns.difference(df.index)
      if len(diff) > 0:
          logger.warning("Components {} for attribute {} of {} are not in main components dataframe {}".format(diff,attr,cls_name,list_name))
  
      attr_series = network.components[cls_name]["attrs"].loc[attr]
      columns = dataframe.columns
  
      diff = network.snapshots.difference(dataframe.index)
      if len(diff):
          logger.warning("Snapshots {} are missing from {} of {}. Filling with default value '{}'".format(diff,attr,cls_name,attr_series["default"]))
          dataframe = dataframe.reindex(network.snapshots, fill_value=attr_series["default"])
  
      if not attr_series.static:
          pnl[attr] = pnl[attr].reindex(columns=df.index|columns, fill_value=attr_series.default)
      else:
          pnl[attr] = pnl[attr].reindex(columns=(pnl[attr].columns | columns))
  
      pnl[attr].loc[network.snapshots, columns] = dataframe.loc[network.snapshots, columns]
docs: Import time series from a pandas DataFrame.
  
      Parameters
      ----------
      dataframe : pandas.DataFrame
      cls_name : string
          Name of class of component
      attr : string
          Name of series attribute
  
      Examples
      --------
      >>> import_series_from_dataframe(dataframe,"Load","p_set")