We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3475e7a commit c156046Copy full SHA for c156046
D15_groupy/homework.py
@@ -10,7 +10,9 @@
10
print( score_df.groupby(['class']).agg(['max','min']) )
11
12
# 找出數學班平均最高的班級?
13
-print( score_df.groupby(['class']).math_score.agg(['max']))
+# print( score_df.groupby(['class']).math_score.agg(['max']))
14
+print( score_df.groupby(['class']).math_score.mean() )
15
16
# 分析全校女生與男生國文平均差幾分?
-print( score_df.groupby(['sex']).chinese_score.agg(['mean']))
17
+print( A:=score_df.groupby(['sex']).chinese_score.agg(['mean']))
18
+print( '全校女生與男生國文平均差幾分 %f' % (float(A.values[0])-float(A.values[1]) ) )
0 commit comments