I'm trying to do interpolation on a large list of data of the format {{x1, y1}, {x2, y2}, {x3, y3}, ..., {xn, yn}}
that is exported from a simulation.
Unfortunately, the exported data has some points {x_(i), y_(i)}
and {x_(i + 1), y_(i + 1)}
that share the same x point: x_(i) = x_(i + 1)
. This is just because of poor precision in the export process from the simulation.
The interpolation function doesn't like the fact that there are duplicate points that share the same x value, and gives me an error message with no output interpolation.
I want to take the duplicate points {x_(i), y_(i)}
and {x_(i + 1), y_(i + 1)}
, average y_(i)
and y_(i + 1)
and remove x_(i + 1)
from the list. The final list should have no duplicates.
It should be pretty straightforward. I'm just a little slow at programming, because I don't have to do it very often.