code: def enrich(self, columns, groupby):
          
  
          for column in columns:
              if column not in self.data.columns:
                  return self.data
  
          for column in columns:
              df_grouped = self.data.groupby([groupby]).agg({column: 'max'})
              df_grouped = df_grouped.reset_index()
              df_grouped.rename(columns={column: 'max_' + column}, inplace=True)
              self.data = pandas.merge(self.data, df_grouped, how='left', on=[groupby])
  
              df_grouped = self.data.groupby([groupby]).agg({column: 'min'})
              df_grouped = df_grouped.reset_index()
              df_grouped.rename(columns={column: 'min_' + column}, inplace=True)
              self.data = pandas.merge(self.data, df_grouped, how='left', on=[groupby])
  
          return self.data
docs: This method calculates the maximum and minimum value
          of a given set of columns depending on another column.
          This is the usual group by clause in SQL.
  
          :param columns: list of columns to apply the max and min values
          :param groupby: column use to calculate the max/min values
          :type columns: list of strings