code: def apply_postprocessing(x_init, postprocessing):
      """
      Transforms x_init depending on postprocessing parameters.
  
      Parameters
      ----------
      x_init: pandas.Dataframe
          Dataframe that needs to be modified
      postprocessing: dict
          Modifications to apply in x_init dataframe.
  
      Returns
      -------
      pandas.Dataframe
          Modified DataFrame.
      """
      new_preds = x_init.copy()
      for feature_name in postprocessing.keys():
          dict_postprocessing = postprocessing[feature_name]
          data_modif = new_preds[feature_name]
          new_datai = list()
  
          if dict_postprocessing["type"] == "prefix":
              for value in data_modif.values:
                  new_datai.append(
                      dict_postprocessing["rule"] + str(value)
                  )
              new_preds[feature_name] = new_datai
  
          elif dict_postprocessing["type"] == "suffix":
              for value in data_modif.values:
                  new_datai.append(
                      str(value) + dict_postprocessing["rule"]
                  )
              new_preds[feature_name] = new_datai
  
          elif dict_postprocessing["type"] == "transcoding":
              unique_values = x_init[feature_name].unique().tolist()
              unique_values = [
                  value
                  for value in unique_values
                  if value not in dict_postprocessing["rule"].keys()
              ]
              for value in unique_values:
                  dict_postprocessing["rule"][value] = value
              new_preds[feature_name] = new_preds[feature_name].map(
                  dict_postprocessing["rule"]
              )
  
          elif dict_postprocessing["type"] == "regex":
              new_preds[feature_name] = new_preds[feature_name].apply(
                  lambda x: re.sub(
                      dict_postprocessing["rule"]["in"],
                      dict_postprocessing["rule"]["out"],
                      x,
                  )
              )
  
          elif dict_postprocessing["type"] == "case":
              if dict_postprocessing["rule"] == "lower":
                  new_preds[feature_name] = new_preds[
                      feature_name
                  ].apply(lambda x: x.lower())
              elif dict_postprocessing["rule"] == "upper":
                  new_preds[feature_name] = new_preds[
                      feature_name
                  ].apply(lambda x: x.upper())
  
      return new_preds
  
file_path: shapash/shapash/utils/transform.py
imports: from shapash.utils.columntransformer_backend import columntransformer, inv_transform_ct, supported_sklearn, transform_ct, get_col_mapping_ct
  from shapash.utils.category_encoder_backend import transform_ce, inv_transform_ce, supported_category_encoder, get_col_mapping_ce
  import re
  import numpy
  import pandas
label_desc: Use image node_id 5 for calling a global function with example usage: apply_postprocessing(x_init, postprocessing) and returns: new_preds