code: def _post_process_apply(self, result_data, axis, try_scale=True):
          
          if try_scale:
              try:
                  internal_index = self.compute_index(0, result_data, True)
              except IndexError:
                  internal_index = self.compute_index(0, result_data, False)
              try:
                  internal_columns = self.compute_index(1, result_data, True)
              except IndexError:
                  internal_columns = self.compute_index(1, result_data, False)
          else:
              internal_index = self.compute_index(0, result_data, False)
              internal_columns = self.compute_index(1, result_data, False)
          if not axis:
              index = internal_index
              # We check if the two columns are the same length because if
              # they are the same length, `self.columns` is the correct index.
              # However, if the operation resulted in a different number of columns,
              # we must use the derived columns from `self.compute_index()`.
              if len(internal_columns) != len(self.columns):
                  columns = internal_columns
              else:
                  columns = self.columns
          else:
              columns = internal_columns
              # See above explanation for checking the lengths of columns
              if len(internal_index) != len(self.index):
                  index = internal_index
              else:
                  index = self.index
          return self.__constructor__(result_data, index, columns)
docs: Recompute the index after applying function.
  
          Args:
              result_data: a BaseFrameManager object.
              axis: Target axis along which function was applied.
  
          Returns:
              A new PandasQueryCompiler.