code: def max_rel_diff_index(curve_ref, curve, min_value=0.01):
      
      assert len(curve_ref) == len(curve), (len(curve_ref), len(curve))
      assert len(curve), 'The curves are empty!'
      diffs = [max_rel_diff(c1, c2, min_value)
               for c1, c2 in zip(curve_ref, curve)]
      maxdiff = max(diffs)
      maxindex = diffs.index(maxdiff)
      return maxdiff, maxindex
docs: Compute the maximum relative difference between two sets of curves.
      Only values greather or equal than the min_value are considered.
      Return both the maximum difference and its location (array index).
  
      >>> curve_refs = [[0.01, 0.02, 0.03, 0.05], [0.01, 0.02, 0.04, 0.06]]
      >>> curves = [[0.011, 0.021, 0.031, 0.051], [0.012, 0.022, 0.032, 0.051]]
      >>> max_rel_diff_index(curve_refs, curves)
      (0.2, 1)