
图11-a

(1)按省份统计各省双一流大学数量,并输出前5项,效果如图b所示。
import pandas as pd
import matplotlib. pyplot as plt
data= pd. read_excel("
df=pd. DataFrame(data,columns=["省份","双一流"])
df1=df[df["双一流"]=="是"]#筛选出双一流学校
#按省份统计双一流大学数量
g=df1. groupby("省份",as_index=True). count()
print(g. head(5))
(2)筛选双一流大学不少于浙江省的省份(含浙江省),并输出符合条件省份数量
zj=g. at["浙江","双一流"]
g=g[
(3)使用柱形图呈现双一流大学不少于浙江省的省份分布情况,效果如图c所示。

图c
g_sort=g. sort_values( )
plt. figure(figsize=(10,6))
plt. bar(g. index, g. 双一流) #绘制柱形图
plt. title('双一流高校分布情况',fontsize = 20) #设置图表标题文字
plt. show()
(4)观察图c柱形图分布,方框处代码应为:
A.“省份”,ascending=False B.“双一流”,ascending=False
C.“省份”,ascending=True D.“双一流”,ascending=True

同类型试题

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

