I have some data that is two dimensional (traditional (x, y) format) as so:
var = {{x1, y1}, {x2, y2}, {x3, y3}}
I would like to search through that large list and find the maximum and minimum y values and return the ordered pair. Something like:
min[var]->{x2, y2} //read "->" as returns {the minimum ordered pair}
max[var]->{x3, y3} //read "->" as returns {the maximum ordered pair}
Finally I know the data has a "root". A plot of the points cross the x-axis. I would like to find the closest few (maybe 3 or 4) points to zero. Questions similar to this have been posted but I cannot figure out how to adapt those solutions to my needs
var[[Ordering[var[[All, 2]]][[1]]]]
andvar[[Ordering[var[[All, 2]]][[-1]]]]
? $\endgroup$