easyui 做网站wordpress主题缩略图
web/
2025/10/8 20:15:07/
文章来源:
easyui 做网站,wordpress主题缩略图,上海申远装饰公司官网,南宁做网站培训有一个表格#xff0c;想要具体分析里面的数据#xff0c;获得在一定条件下的结果#xff0c;并且想要比较好的可视化。
下面的脚本涉及
修改 列的名字#xff0c;并用excel 中的列名索引剔除第一行#xff0c;去掉没打分的行对所选择的列统计#xff0c;并更好的可视化…有一个表格想要具体分析里面的数据获得在一定条件下的结果并且想要比较好的可视化。
下面的脚本涉及
修改 列的名字并用excel 中的列名索引剔除第一行去掉没打分的行对所选择的列统计并更好的可视化出来
这里需要说明的是最后的定义的两个函数其实只是为了名字好看
from chj.comm.pic import *import pandas as pdimport string
import csvbrief list(string.ascii_uppercase[:14])
columns brief # 自己换上合适的名字mp_brief{}
for a, b in zip( brief, columns ):mp_brief[ a ] bwith open(aimotion.csv, r, newline) as file:reader csv.DictReader(file, fieldnamescolumns)next(reader)data [row for row in reader]df pd.DataFrame(data)df.columns columns [None]
#del_nms[talk_zxf_schooldiff, talk_slow_nosense]
del_nms[talk_slow_nosense]
df df[~df[ mp_brief[ B ] ].isin(del_nms)]# 剔除 F G H I 这四列不为浮点数的行
cols [F, G, H, I]
cols [ mp_brief[e] for e in cols ]print( df[cols] )
#df df[pd.to_numeric(df[cols], errorscoerce).notnull().all(axis1)]
df[cols] df[cols].apply(pd.to_numeric, errorscoerce)
df df.dropna(subsetcols)def mean(x):return round(x.mean(), 3)def std(x):return round(x.std(), 3)#grouped df.groupby( mp_brief[ D ] )[cols].agg([mean, var])
#custom_agg lambda x: round(x.mean(), 3), lambda x: round(x.std(), 3)
custom_agg [ mean, std ]
grouped df.groupby( mp_brief[ D ] )[cols].agg( custom_agg )
grouped grouped.reset_index()
#grouped.columns [mean, std] * len( cols )
print(grouped)#html_table grouped.to_html()
html_table grouped.to_html(classesstyled-table, justifycenter, border0)
# 添加样式信息
html_table fstyle.styled-table {{border-collapse: collapse; margin: 20px;}} .styled-table td, .styled-table th {{border: 1px solid black; padding: 8px; text-align: center;}}/style{html_table}with open(output_table.html, w) as file:file.write(html_table)print(HTML table exported and saved as output_table.html)生成的网页
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/89243.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!