code: def pivot(self, index, **kwargs):
          
          try:
              df = self._pivot(index, **kwargs)
              return pd.pivot_table(self.df, index=kwargs["index"],  **kwargs)
              """if df is None:
                  self.err("Can not pivot table")
                  return
              self.df = df"""
          except Exception as e:
              self.err(e, "Can not pivot dataframe")
docs: Pivots a dataframe