code: def trimmed_mean(self, p1, p2):
          
          if not (p1 < p2):
              raise ValueError("p1 must be between 0 and 100 and less than p2.")
  
          min_count = p1 / 100. * self.n
          max_count = p2 / 100. * self.n
  
          trimmed_sum = trimmed_count = curr_count = 0
          for i, c in enumerate(self.C.values()):
              next_count = curr_count + c.count
              if next_count <= min_count:
                  curr_count = next_count
                  continue
  
              count = c.count
              if curr_count < min_count:
                  count = next_count - min_count
              if next_count > max_count:
                  count -= next_count - max_count
  
              trimmed_sum += count * c.mean
              trimmed_count += count
  
              if next_count >= max_count:
                  break
              curr_count = next_count
  
          if trimmed_count == 0:
              return 0
          return trimmed_sum / trimmed_count
docs: Computes the mean of the distribution between the two percentiles p1 and p2.
          This is a modified algorithm than the one presented in the original t-Digest paper.