有没有我可以用来绘制一系列等级的功能? [英] Is there a function I can use to graph a range of grades?
本文介绍了有没有我可以用来绘制一系列等级的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用myplotlib,并希望将成绩分为不同的类别,如[90,100],[80,90],[70,80]等。是否有分类值范围的功能?
解决方案
您可能最好编写自己的函数来解决问题。下面的例子不是一个完整的解决方案,但我如何解决问题,也可能是一个很好的起始空间。
假设您正在将学生的数字等级分类为A,B,C,D,E ...
你有一个listList of list [[studentName,numGrade]]
对于eachStudent in classList:
if numGrade> = 90
classList [x] .append = A
if numGrade< = 90 和> = 80
classList [x] .append = B
....
最后其中你应该能够创建一个列表列表,它将学生的字母等级分类为他们所获得的数字等级。
I am using myplotlib and want to sort grades into different categories like [90, 100], [80,90) , [70,80), etc. Is there a function for categorizing a range of values?
解决方案You may be best off writing your own function to address the problem. The below example is not a complete solution, but how i would approach the problem and might be a good starting space for you too.
Lets imagine that you are sorting students numerical grades into A, B, C, D, E...
and you have a classList of lists [[studentName, numGrade]]
For eachStudent in classList: if numGrade >= 90 classList[x].append = "A" if numGrade <= 90 and >= 80 classList[x].append = "B"
....
At the end of of it you should be able to create a list of lists, that has categorized the letter grade of the student to the numerical grade they have earned.
这篇关于有没有我可以用来绘制一系列等级的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文