2021年信号与系统作业统计处理

Posted 卓晴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2021年信号与系统作业统计处理相关的知识,希望对你有一定的参考价值。

简 介: 对于2021年信号与系统分析课程作业成绩进行整理

关键词 信号与系统作业成绩

 

§01 业原始表格


一、原始数据表格

  由助教提交的作业统计的原始表格如下图所示。

1、表单结构

(1)表单的基本结构:
行数:176,数据行数为175
列数:35,从A ~ AI

▲ 图1.1 作业统计情况

▲ 图1.1 作业统计情况

(2)表格列的定义:
A:学号
B:姓名
C:星标
D:院系
E:班级
F-AI:15次作业,分数:备注

二、表格处理

1、读取表格内容

(1)将EXCEL转换成LIST

  通过以下程序,将原始表格的内容转换成list。

from headm import *
import pandas as pd

#------------------------------------------------------------
def showexcel(filename):
    excelfile = pd.read_excel(filename, sheet_name="sheet1")
    listdata = excelfile.values.tolist()

    strall = ''
    for id,l in enumerate(listdata):
        printff(id, l)

    return listdata
from head import *
import inforsub
hworg = tspstring2text('hworg')
hwresult = tspstring2text('hwresult')
listdata = inforsub.showexcel(hworg)
tspsave('orgdata', listdata=listdata)
(2)读取listdata
listdata = tspload('orgdata', 'listdata')
printf(listdata)
[['2014011563' '冉靖尧' '男' ... 'nan' '0' 'nan']
 ['2017010370' '吴明辉' '男' ... 'nan' '0' 'nan']
 ['2017010677' '曹宇轩' '男' ... 'nan' '0' 'nan']
 ...
 ['2019050017' '杨紫妍' '女' ... 'nan' '10' '强']
 ['2019080349' '雍子隆' '男' ... 'nan' '10' 'nan']
 ['2020011096' '周建东' '男' ... 'nan' '10' '强']]

2、汇总表格算法

listdata = tspload('orgdata', 'listdata')
#------------------------------------------------------------
score = []
summary = []
for l in listdata:
    sc = l[5::2]
    sc[sc=='nan'] = '0'
    scnum = [float(s) for s in sc]
    score.append(sum(scnum))
    sumstr = ['%s:%s'%(s1,s2) for s1,s2 in zip(l[5::2],l[6::2])]
    str = ';'.join(sumstr).replace('nan', '')
    printf(str)
    summary.append(str)
tspsave('scoresum', score=score, summary=summary, listdata=listdata)
printf('\\a')

3、写入结果表格

(1)写入程序
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# WRITERLT.PY                  -- by Dr. ZhuoQing 2021-07-01
#
# Note:
#============================================================

from head import *
import inforsub

score, summary, listdata = tspload('scoresum', 'score', 'summary', 'listdata')

resultfile = tspstring2text("hwresult")
printf(resultfile)

for id,s in enumerate(score):
    sid = listdata[id][0]
    sumstr = summary[id]

#    printff(sid, s, sumstr)

    ret = inforsub.setexcelcellstring(resultfile, sid, "分数", s)
    ret = inforsub.setexcelcellstring(resultfile, sid, "总结", sumstr)

    if ret < 0:
        printff("ERROR:", sid, s, sumstr)

#    if id > 10: break

printf("\\a")

#------------------------------------------------------------
#        END OF FILE : WRITERLT.PY
#============================================================
(2)没有对应的学生

  总共有六个学生没有对应的结果。

ERROR: 2017010370 20.0 10:;10:;0.0:;0:;0:未交;0:;0:;0.0:;0:;0:;0:;0.0:;0:;0:;0:
ERROR: 2017010677 20.0 10:;10:;0.0:;0:;0:未交;0:;0:;0.0:;0:;0:;0:;0.0:;0:;0:;0:
ERROR: 2018011555 0.0 0:上传的是题目;0:;0.0:;0:;0:未交;0:;0:;0.0:;0:;0:;0:;0.0:;0:;0:;0:
ERROR: 2018012382 60.0 10:;10:;10.0:;10:;10.0:;10:;0:;0.0:;0:;0:;0:;0.0:;0:;0:;0:
ERROR: 2019012682 30.0 10:;10:;0.0:;0:;0:未交;0:;0:;0.0:;0:;0:;0:;10.0:;0:;0:;0:
ERROR: 2019013372 13.0 8:16题没有;5:;0.0:;0:;0:未交;0:;0:;0.0:;0:;0:;0:;0.0:;0:;0:;0:
(3)最后统计结果
  学号姓名分数
2014011563冉靖尧90
2017011044蔡漫锋139
2017011574吕光冉110
2018010352张卓宇150
2018010520孙超150
2018010521张一博140
2018010682潘文凯150
2018010691黄昭源145
2018010740徐昕翃133
2018010756张凯145
2018010783昕琦150
2018011464陈吉坤146
2018011495杨小诺148
2018011524刘毓灵74.5
2018011682闫泽150
2018011738袁彦龙150
2018011855褚驰150
2018012075孙熙凯150
2018012249瞿近远140
2018012263陈景浩64
2019010134卢逸名150
2019010421武昊150
2019010452王与时150
2019010465姜永鹏150
2019010482徐诣堡145
2019010485刘祖炎150
2019010532刘康城150
2019010550苍岳洋150
2019010552邢海潼145
2019010627周思维20
2019010643仇铮150
2019010645尹鹏149
2019010659余珮琪145
2019010674李晨韬150
2019010702周义函150
2019010708关博文140
2019010729时清扬150
2019010733王韬钧150
2019010745陈浩150
2019010804张智凯150
2019010807黄哲150
2019010808孟子斌150
2019010812牟准150
2019010815江群150
2019010819李永健150
2019010821李述150
2019010830高瞻远138
2019010836晏国凯150
2019010837陈洋150
2019010838许伟超150
2019010840谭跳150
2019010842何琳欣150
2019010850王逸钦149
2019010874谭龙涛150
2019010927王洹芊150
2019010932张睿喆150
2019011351左思清125
2019011352王啸轩150
2019011353闫梦蓓150
2019011355赵健桐150
2019011356康宇琦150
2019011358陈星149
2019011359王浩驰147
2019011363尹子康150
2019011364赖正宇150
2019011365骆科燚149
2019011367吴晔140
2019011369李俊杰150
2019011370王可150
2019011371王觉140
2019011372刘禹辰78
2019011374张博轩150
2019011376张云帆145
2019011378邓皓天140
2019011379于端瑞140
2019011380谷彧潇150
2019011381周亦哲150
2019011382杨鼎148.5
2019011383陈祥艺150
2019011385曹健博150
2019011386李亮龙150
2019011389张仁刚150
2019011390金理想139
2019011392黄语萱150
2019011393袁铭150
2019011394贾宇飞140
2019011395姚祎宁138.5
2019011396姜芯雨150
2019011397王博闻138
2019011398宋晓斌150
2019011399彭昱玚145
2019011400陈天瑞135
2019011401储勇148.5
2019011402张世乙139.5
2019011403魏浩150
2019011406李可伊150
2019011408黄彦彬150
2019011410何杰铃140
2019011411郑阳127
2019011412蔡颂濠145
2019011413周耀140
2019011414陈华清139
2019011415付迪帆148
2019011417杨宇新150
2019011418谢宇轩150
2019011421曹展翔140
2019011422邢旺150
2019011424钟毅150
2019011425李若然150
2019011426李浦豪150
2019011427韩东辰150
2019011428姚泊先145
2019011429雍征彼150
2019011430徐赫临150
2019011431叶金涛140
2019011433刘梓哲150
2019011434吕梦欣150
2019011436陈冠宇150
2019011437栾垚150
2019011438陈卓明150
2019011439于江伟140
2019011440沈念辰150
2019011443左思成150
2019011445梁亨源150
2019011446陈禹为150
2019011447仝牧坤150
2019011448张启航144
2019011450陈文泽150
2019011451郑姝榕150
2019011452杨珂凡150
2019011453吴征鸿150
2019011454宋雨璠150
2019011455曲世远150
2019011457明陈林140
2019011458党添添150
2019011460杨一凡150
2019011462何东阳150
2019011463黄正超150
2019011464盘卓实150
2019011465杜邦得100
2019011467温昊150
2019011468刘楠150
2019011470邢森140
2019011471任坤150
2019011472付欣旺30
2019011473王献文70
2019011474胡鑫豪150
2019011475王少儒79
2019011494杨凌晓140
2019011523尹航140
2019011549夏星鹏145
2019011584袁梦150
2019011605周佳祺144
2019011616魏冰川140
2019011750武可雯150
2019011879刘雪洁150
2019012151张帅138
2019012428邱亦文150
2019012437吕畅祺140
2019012441柴睿75
2019012446黄嘉诚145
2019012447金熠琦150
2019012448杨思行150
2019012450刘逸凯150
2019013315曹哲暄140
2019050016李子韩150
2019050017杨紫妍150
2019080349雍子隆150
2020011096周建东126

三、作业统计

1、得分统计

  可参考的Python语句: python–plt.hist函数的输入参数和返回值的解释

from headm import *

score, summary, listdata = tspload('scoresum', 'score', 'summary', 'listdata')

ret = plt.hist(score, 15)
printf('|'.join([str(int(n)) for n in ret[0]]))
printf(sum(score) / len(score))

plt.xlabel("分数范围")
plt.ylabel("频数")
plt.grid(True)
plt.tight_layout()
plt.show()
(1)得分数值
[ 90.   20.   20.  139.  110.  150.  150.  140.  150.  145.  133.  145.
 150.  146.  148.   74.5   0.  150.  150.  150.  150.  140.   64.   60.
 150.  150.  150.  150.  145.  150.  150.  150.  145.   20.  150.  149.
 145.  150.  150.  140.  150.  150.  150.  150.  150.  150.  150.  150.
 150.  150.  138.  150.  150.  150.  150.  150.  149.  150.  150.  150.
 125.  150.  150.  150.  150.  149.  147.  150.  150.  149.  140.  150.
 150.  140.   78.  150.  145.  140.  140.  150.  150.  148.5 150.  150.
 150.  150.  139.  150.  150.  140.  138.5 150.  138.  150.  145.  135.
 148.5 139.5 150.  150.  150.  140.  127.  145.  140.  139.  148.  150.
 150.  140.  150.  150.  150.  150.  150.  145.  150.  150.  140.  150.
 150.  150.  150.  150.  140.  150.  150.  150.  150.  150.  144.  150.
 150.  150.  150.  150.  150.  140.  150.  150.  150.  150.  150.  100.
 150.  150.  140.  150.   30.   70.  150.   79.  140.  140.  145.  150.
 144.  140.  150.  150.  138.  150.  140.   75.  145.  150.  150.  150.
  30.  140.   13.  150.  150.  150.  126. ]
(2)得分分布

【表1-1 作业各分段的分布】

  102030405060708090100110120130140150
113200250111310145
  • 平均得分: 138.02

▲ 作业各分段的分布

▲ 作业各分段的分布


■ 相关文献链接:

● 相关图表链接:

以上是关于2021年信号与系统作业统计处理的主要内容,如果未能解决你的问题,请参考以下文章

2021年春季学期-信号与系统-第十一次作业参考答案

2021年春季学期-信号与系统-第十三次作业参考答案

2021年春季学期-信号与系统-第十五次作业参考答案

2021年春季学期-信号与系统-第十四次作业参考答案

2021年春季学期-信号与系统-第十四次作业参考答案-第五小题参考答案

信号与系统 2022s 作业统计处理 - CDIE