I have a list which looks like:
test = {{0.01,3}, {0.001,3.1}, {0.002,3.2}, ..., {0.01,7}, {0.001,7.1}, {0.002,7.2}, ...,
{0.01,10}, {0.001,10.1}, {0.002,10.2}, ..., {0.01,13}, {0.001,13.1}, {0.002,13.2}}
What I would like to do is for every value of the second coordinate that is close to a centre value (near 3
, 7
, 10
or 13
) I only want to keep the ones (pairs) that have the smallest value of the first coordinate. After this transformation the list would become:
{{0.001,3.1}, {0.001,7.1}, {0.001,10.1}, {0.001,13.1}}
Note that when I have entered a break in the test list there is also a spacing in the 2nd coordinate values, so the list runs from say 3 - 3.5
and then skips to 7 - 7.5
and so on; it is not a continuous count.
Also, the values of the first coordinates are not equal, as those given in the example above, so the list may end up looking like
{{0.001, 3.1}, {0.005, 7.2}, {0.00001, 10.3}, {0.007, 13.4}}
which is still a correct result.
IntegerPart
orRound
or something else? $\endgroup$ – bobthechemist Feb 6 '14 at 4:12