code: def transform_dataframe(self, dataframe):
          
          dataframe.columns.name = ""
  
          for i in range(len(self.get_header_fields())):
              dataframe = dataframe.unstack()
  
          # Remove blank rows / columns
          dataframe = dataframe.dropna(
              axis=0, how='all'
          ).dropna(
              axis=1, how='all'
          )
          return dataframe
docs: Unstack the dataframe so header fields are across the top.