code: def pivot_table(self, index, columns, values='value',
                      aggfunc='count', fill_value=None, style=None):
          
          index = [index] if isstr(index) else index
          columns = [columns] if isstr(columns) else columns
  
          df = self.data
  
          # allow 'aggfunc' to be passed as string for easier user interface
          if isstr(aggfunc):
              if aggfunc == 'count':
                  df = self.data.groupby(index + columns, as_index=False).count()
                  fill_value = 0
              elif aggfunc == 'mean':
                  df = self.data.groupby(index + columns, as_index=False).mean()\
                      .round(2)
                  aggfunc = np.sum
                  fill_value = 0 if style == 'heatmap' else ""
              elif aggfunc == 'sum':
                  aggfunc = np.sum
                  fill_value = 0 if style == 'heatmap' else ""
  
          df = df.pivot_table(values=values, index=index, columns=columns,
                              aggfunc=aggfunc, fill_value=fill_value)
          return df
docs: Returns a pivot table
  
          Parameters
          ----------
          index: str or list of strings
              rows for Pivot table
          columns: str or list of strings
              columns for Pivot table
          values: str, default 'value'
              dataframe column to aggregate or count
          aggfunc: str or function, default 'count'
              function used for aggregation,
              accepts 'count', 'mean', and 'sum'
          fill_value: scalar, default None
              value to replace missing values with
          style: str, default None
              output style for pivot table formatting
              accepts 'highlight_not_max', 'heatmap'