导入库

import pandas as pd

读取数据源

data=pd.read_csv('weather7.csv',encoding='utf-8')

获取降雨量数据

data_rf=data['降雨量']

计数器

count=0

#统计降雨量为0的天数 for i in range(len(data_rf)): if data_rf[i]==0: count+=1

#以下输出语句,无需修改 print(count) #根据测试源,判定结果(测试数据结果:167)

Python程序统计降雨量为零的天数

原文地址: https://www.cveoy.top/t/topic/oV7k 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录