I have a DataFrame
called df
and it has 4 columns, like the one presented below:
A B C Class
12 13 22 1
8 15 20 1
9 14 25 1
18 9 35 2
5 14 30 2
4 12 28 2
35 87 67 3
35 82 66 3
20 7 32 4
10 8 32 4
22 7 31 4
... ... ... ...
What I want is to find the min and max for every column with respect to the class. In other words, I would like to get a result similar to the one below:
Class: 1
A: [8, 12]
B: [13, 15]
C: [20, 25]
Class: 2
A: [4, 18]
B: [9, 14]
C: [28, 35]
Class: 3
A: [35, 35]
B: [82, 87]
C: [66, 67]
...