答案 0 :(得分:3)
您可以对布尔值求和
df.set_index('school').ge(70).sum(level=0)
reading_score reading_score2
school
Rosemead High School 2.0 1.0
SDDE High School 1.0 1.0
Arcadia High School 1.0 2.0
df = pd.DataFrame([
['Rosemead High School', 66, 79],
['Rosemead High School', 94, 61],
['Rosemead High School', 90, 60],
['SDDE High School', 67, 58],
['SDDE High School', 97, 84],
['Arcadia High School', 70, 80],
['Arcadia High School', 50, 55],
['Arcadia High School', 65, 77],
], columns=['school', 'reading_score', 'reading_score2'])
答案 1 :(得分:2)
我认为首先需要过滤:
action= '<?php echo $_SERVER["PHP_SELF"] ?>