(1)若要体现每所的学校信息技术总分的高分,应进行的操作是:先按字段进行分组,再利用函数统计对总分求最大值。
(2)若要求每所学校每个班级的平均分,应进行的操作是:先按和字段进行分组,再利用函数统计对班级求平均值。
(3)将各学校各班级总分的平均分导出到“结果,xlsx”文件中。
实现上述功能的代码如下,请在程序划线处填入合适的代码。
import pandas as pd
import matplotlib.pyplot as plt
s1=pd.read_excel(″cj.xlsx″)
g=s1.groupby(″学校″,as_index=False)
s2=g.总分.max()
rects=plt.bar(______①
plt.title('各学校最高分')
plt.legend() #显示系列
plt.show
#求各学校各班级总分的平均分
g=s1.groupby([″学校″,″班级″]).______③
______④

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

