Max or min depending on another variable
问题 I need to calculate the max and min of the wave height according to the direction from which it comes, that is to say, I have two variables: Hs (wave height) Direction (direction of the swell) And I need to know the maximum wave height for waves with a direction between 11.25 and 33.75 degrees. For now, use the function: Max (Hs [Direction [11.25: 33.75])) But I do not agree the result with the data that I have. 回答1: Assume your dataframe is called df , your variables are called Hs and