表1 空气质量指数(AQI)划分标准
图a
图b
f=open("日均 AQI.csv","r")
grade={"优":0,"良":0,"轻度污染":0,"中度污染":0,"重度污染":0,"严重污染":0}
for line in f:
a=line.split(",") #列表a数据格式形如['11 月7 日', '41.17', '63.75']
t=float(_____)
if t<=50:
key="优"
elif t<=100:
key="良"
elif t<=150:
key="轻度污染"
elif t<=200:
key="中度污染"
elif t<=300:
key="重度污染"
grade[key]+=1
print("本周共有"+str(grade["优"])+"天的空气质量为优")