min and max for specific rows in a column [duplicate]

           X             Y
 1:        2          1.973203
 2:        2          1.985226
 3:        2          1.988916
 4:        2          1.998701
 5:        2          1.998701
 6:        5          4.726402
 7:        5          4.854796
 8:        5          4.891613
 9:        5          4.975043
10:        5          4.925852
11:       10          8.808622
12:       10          9.311003
13:       10          9.383758
14:       10          9.719726
15:       10          9.496574
16:       30         19.758713
17:       30         22.318520
18:       30         23.377183
19:       30         24.593082
20:       30         22.787362

Hi, I wanted to find the min and max of each x. For example, min and max of 2 (i.e. X) and min & max of 5 , 10 and 30. For each X, there are 5 values of Y. So, I wanted to find min and max and each of X. I was doing it in a lengthy way. Is there a simpler way to do it? Thanks!



Read more here: https://stackoverflow.com/questions/67379344/min-and-max-for-specific-rows-in-a-column

Content Attribution

This content was originally published by Zohaib at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: