import xlrd
import matplotlib
# matplotlib.use('Agg') #不显示作图过程import matplotlib.pyplot as plt
import os
读EXCEL
defread_excel(path):#打开工作簿wb=xlrd.open_workbook(path)#查看工作表名字sheet_name=wb.sheet_names()[0]print(sheet_name)#获取工作表# sheet=wb.sheet_by_index(0)sheet=wb.sheet_by_name(sheet_name)#获取行数和列数nrows=sheet.nrowsncols=sheet.ncols#获取每一行都存入列表rows_list=[]for i inrange(nrows):rows_list.append(sheet.row_values(i))return rows_list
分析数据
defgetData():excel_path='./医院.xlsx'#急诊科男女分别的人数,医院就诊的人数,每个诊室就诊人数,并在控制台输出,ls=read_excel(excel_path)# print(ls)xingbie_dir={}keshi_dir={}renshu_dir={}for i inrange(1,len(ls)):if ls[i][1]in xingbie_dir:xingbie_dir[ls[i][1]]+=1else:xingbie_dir[ls[i][1]]=1if ls[i][4]in renshu_dir:renshu_dir[ls[i][4]]+=1else:renshu_dir[ls[i][4]]=1if ls[i][3]in keshi_dir:keshi_dir[ls[i][3]]+=1else:keshi_dir[ls[i][3]]=1print(xingbie_dir,keshi_dir,renshu_dir)getData()
饼状图
#获取数据print(xingbie_dir)
xingbie_nums=list(xingbie_dir.values())print(xingbie_nums)
xingbie_label=list(xingbie_dir.keys())print(xingbie_label)
plt.pie( xingbie_nums,labels=xingbie_label,autopct='%1.1f%%',counterclock=False,startangle=90)
plt.title("Male to femal ratio in the last five days of emergency department")
plt.savefig("./饼状图.jpg")
plt.show()
plt.close()
Yet Another Monster Fight
Problem - D - Codeforces
题目大意:
现在给你一堆怪物,你拥有法术(一个法术可以连续攻击这n个所有怪物),你可以选择任意一个怪物作为法术的第一个攻击目标(伤害为xÿ…
行为识别相关的开发实践在我们之前的博文中也有过相关的实践了,感兴趣的话可以自行移步阅读即可:《python实现基于TNDADATASET的人体行为识别》
《UCI行为识别——Activity recognition with healthy older people using a batteryless wearable sensor Data Set》《人体行为…
1、先构建基本的netty框架
再下面的代码中我构建了一个最基本的netty实现websocket的框架,其他个性化部分再自行添加。
Slf4j
public class TeacherServer {public void teacherStart(int port) throws InterruptedException {NioEventLoopGroup boss new NioEve…