Basically I have a 2D numpy array, the first column being my x-axis values and the second being my y-axis values. I want to find the max value of y within a specified range of x values (there are several other max y values that I am not interested in), but I don't necessarily know what index range that would correspond to. How would I write a function where I can specify the range of x values and find the max of the associated y values?
This seems like a simple task but I cannot for the life of me find an approach to this question that doesn't rely on specifying the index range instead of associated values.