I have three classes and I want to find the mean age of male for each class. The below given code is working but if I want to find the mean value of many classes, how can I write this code? c3 = fr1[fr1["class"] ==3] c3w = fr1[fr1["gender"] =='male'] print(round(c3w["Age"].mean()))