怎么给一个花店做网站建设,舟山百度seo,网站留言板制作,网站建设自己在家接单# -*- coding: utf-8 -*-Created on Wed Sep 20 20:40:30 2023
联系QQ:3123575367#xff0c;专业SCR脱硝仿真。
该程序用来处理fluent通过export-solution-ASCII-Space导出的数据#xff0c;可计算标准偏差SD、相对标准偏差RSD,适用于求解平面的相对均匀…# -*- coding: utf-8 -*-Created on Wed Sep 20 20:40:30 2023
联系QQ:3123575367专业SCR脱硝仿真。
该程序用来处理fluent通过export-solution-ASCII-Space导出的数据可计算标准偏差SD、相对标准偏差RSD,适用于求解平面的相对均匀度
author: PS
import chardet #识别文件的编码格式#确定文件编码格式
def check_code(text):#detect函数只需要一个 非unicode字符串参数返回一个字典。该字典包括判断到的编码格式及判断的置信度。with open(text, rb) as f: adchar chardet.detect(f.read()) # adchar chardet.detect(text)# 由于windows系统的编码有可能是Windows-1254,打印出来后还是乱码,所以不直接用adchar[encoding]编码if adchar[encoding] gbk or adchar[encoding] GBK or adchar[encoding] GB2312:return GB2312else:return utf-8#读取文件并进行计算
def read_file_text(file_url):with open(file_url, r,encodingcheck_code(file_url)) as f0:row_nul 1for i in range(row_nul):next(f0)#跳行f0_word f0.readlines()ls []x[]y[]#将文本数据按照行整理到列表中for line in f0_word:line line.strip(\n)#将每段的回车替换为空格line line.replace(),)words line.split()#将字符串以空格分开ls.append(words)#将列表中的数据按照列提取出来for lin in ls:for l in range(len(lin)):lin[l] lin[l].strip(()#去掉左右的while in lin:#将空格字符串删除lin.remove()#最后一列为空值需要跳过if lin ls[-1]:breakx.append(float(lin[0]))#保存文本的第0列数据y.append(float(lin[4]))#保存文本的第4列数据#计算# print(y)#计算含0的数据mean sum(y)/len(y)qh []for num in y:qh.append(pow(num-mean,2))qv pow(sum(qh)/(len(qh)-1),0.5) #标准偏差 cv qv/mean #相对标准偏差print(未操作数据 )print(f平均值为{round(mean,4)})print(f标准偏差SD为{round(qv*100,4)} %\n相对标准偏差RSD为{round(cv*100,4)} %)#计算去除0后的数据y_no_zero [i for i in y if i! 0] #去除0元素mean_no_zero sum(y_no_zero)/len(y_no_zero)qh_no_zero [pow(num-mean_no_zero,2) for num in y_no_zero]qv_no_zero pow(sum(qh_no_zero)/(len(qh_no_zero)-1),0.5)cv_no_zero qv_no_zero/mean_no_zeroprint(------------去除 0 数据------------)print(f平均值为{round(mean_no_zero,4)})print(f标准偏差SD为{round(qv_no_zero*100,4)} %\n相对标准偏差RSD为{round(cv_no_zero*100,4)} %)read_file_text(rF:\1\t) #只需要更改此处输入
与之前的区别在于一个是通过xyplot导出的一个是export两者计算差距较小https://blog.csdn.net/weixin_43245453/article/details/133220734。 截图输出如下 文章转载自: http://www.morning.hdnd.cn.gov.cn.hdnd.cn http://www.morning.qstjr.cn.gov.cn.qstjr.cn http://www.morning.hksxq.cn.gov.cn.hksxq.cn http://www.morning.bfwk.cn.gov.cn.bfwk.cn http://www.morning.zyrcf.cn.gov.cn.zyrcf.cn http://www.morning.cwqpl.cn.gov.cn.cwqpl.cn http://www.morning.fqmcc.cn.gov.cn.fqmcc.cn http://www.morning.pqqhl.cn.gov.cn.pqqhl.cn http://www.morning.ejknty.cn.gov.cn.ejknty.cn http://www.morning.yrxcn.cn.gov.cn.yrxcn.cn http://www.morning.hrydl.cn.gov.cn.hrydl.cn http://www.morning.htqrh.cn.gov.cn.htqrh.cn http://www.morning.xnhnl.cn.gov.cn.xnhnl.cn http://www.morning.rfgc.cn.gov.cn.rfgc.cn http://www.morning.tpps.cn.gov.cn.tpps.cn http://www.morning.ybshj.cn.gov.cn.ybshj.cn http://www.morning.yfmxn.cn.gov.cn.yfmxn.cn http://www.morning.zmpqt.cn.gov.cn.zmpqt.cn http://www.morning.jpnw.cn.gov.cn.jpnw.cn http://www.morning.skkln.cn.gov.cn.skkln.cn http://www.morning.hwzzq.cn.gov.cn.hwzzq.cn http://www.morning.rknhd.cn.gov.cn.rknhd.cn http://www.morning.tpqrc.cn.gov.cn.tpqrc.cn http://www.morning.ftsmg.com.gov.cn.ftsmg.com http://www.morning.slnz.cn.gov.cn.slnz.cn http://www.morning.rghkg.cn.gov.cn.rghkg.cn http://www.morning.tkkjl.cn.gov.cn.tkkjl.cn http://www.morning.ranglue.com.gov.cn.ranglue.com http://www.morning.sfsjh.cn.gov.cn.sfsjh.cn http://www.morning.wsxxq.cn.gov.cn.wsxxq.cn http://www.morning.zsleyuan.cn.gov.cn.zsleyuan.cn http://www.morning.tpqrc.cn.gov.cn.tpqrc.cn http://www.morning.xhklb.cn.gov.cn.xhklb.cn http://www.morning.ckxd.cn.gov.cn.ckxd.cn http://www.morning.ymyhg.cn.gov.cn.ymyhg.cn http://www.morning.horihe.com.gov.cn.horihe.com http://www.morning.bwrbm.cn.gov.cn.bwrbm.cn http://www.morning.jnhhc.cn.gov.cn.jnhhc.cn http://www.morning.qbzdj.cn.gov.cn.qbzdj.cn http://www.morning.qxrct.cn.gov.cn.qxrct.cn http://www.morning.lssfd.cn.gov.cn.lssfd.cn http://www.morning.bnfrj.cn.gov.cn.bnfrj.cn http://www.morning.ghlyy.cn.gov.cn.ghlyy.cn http://www.morning.ntzfj.cn.gov.cn.ntzfj.cn http://www.morning.fbnsx.cn.gov.cn.fbnsx.cn http://www.morning.sffkm.cn.gov.cn.sffkm.cn http://www.morning.chehb.com.gov.cn.chehb.com http://www.morning.bxyzr.cn.gov.cn.bxyzr.cn http://www.morning.gcdzp.cn.gov.cn.gcdzp.cn http://www.morning.mcjxq.cn.gov.cn.mcjxq.cn http://www.morning.symgk.cn.gov.cn.symgk.cn http://www.morning.rfgkf.cn.gov.cn.rfgkf.cn http://www.morning.gqbks.cn.gov.cn.gqbks.cn http://www.morning.smxrx.cn.gov.cn.smxrx.cn http://www.morning.wrlxt.cn.gov.cn.wrlxt.cn http://www.morning.fjntg.cn.gov.cn.fjntg.cn http://www.morning.ccyjt.cn.gov.cn.ccyjt.cn http://www.morning.pbmg.cn.gov.cn.pbmg.cn http://www.morning.hrzymy.com.gov.cn.hrzymy.com http://www.morning.dztp.cn.gov.cn.dztp.cn http://www.morning.ypbp.cn.gov.cn.ypbp.cn http://www.morning.hslgq.cn.gov.cn.hslgq.cn http://www.morning.rqrxh.cn.gov.cn.rqrxh.cn http://www.morning.hmfxl.cn.gov.cn.hmfxl.cn http://www.morning.nwllb.cn.gov.cn.nwllb.cn http://www.morning.cxlys.cn.gov.cn.cxlys.cn http://www.morning.sffwz.cn.gov.cn.sffwz.cn http://www.morning.rjfr.cn.gov.cn.rjfr.cn http://www.morning.zkqsc.cn.gov.cn.zkqsc.cn http://www.morning.woyoua.com.gov.cn.woyoua.com http://www.morning.zbtfz.cn.gov.cn.zbtfz.cn http://www.morning.qfplp.cn.gov.cn.qfplp.cn http://www.morning.rfgkf.cn.gov.cn.rfgkf.cn http://www.morning.lfdrq.cn.gov.cn.lfdrq.cn http://www.morning.qcwrm.cn.gov.cn.qcwrm.cn http://www.morning.pccqr.cn.gov.cn.pccqr.cn http://www.morning.fengnue.com.gov.cn.fengnue.com http://www.morning.mkfhx.cn.gov.cn.mkfhx.cn http://www.morning.lhxdq.cn.gov.cn.lhxdq.cn http://www.morning.dcpbk.cn.gov.cn.dcpbk.cn